I am making my first app for the iphone. As of right now, I don’t have a ipad/iphone (until next week), and I have only been able test my game using the screen resolution of 480x320, thats the iphone 3g settings correct? I have also tried 960x640, and it looks fine as well… is this safe?
However, when I set the resolution to 1024x768, it doesn’t look right at all. The functionality is ok, just placements of gui textures/texts are way off.
How is everyone else testing their games? Does everyone have a iphone 3g/4g and ipad? What’s the best way to make my games cross compatible across all these different resolutions?
Thanks!
That really depends on what you mean by “way off” and what you want it to look like. If your game looks fine in the two iPhone resolutions, then it sounds like you’ve got scale handled properly. The big difference between the iPad and iPhone is the screen aspect ratio. The iPhone is 3:2 in landscape, whereas the iPad is 4:3.
It’s up to you to figure out how you want to scale and/or translate interface elements to adjust for this difference.
Whenever I set positions and sizes of GUI objects, I always make it relative to Screen.Width and Screen.Height. Then it looks right for all platforms. Eg:
GUI.Label(new Rect(Screen.width / 8, Screen.height / 3, Screen.width / 2.5f, Screen.height / 4), "", guiStyle);
It takes a bit of playing around with the values to make it look right, but once its right, its right for all screen sizes.
@disband85
I really like your idea, I will have to put this into practice asap. I assume you can do the same thing with Textures that are Buttons? They should be handled the same way, correct?