iOS game development: handling different screen resolutions [deprecated]
My favorite option for iOS game development is to use just the exact size for the assets that each device actually uses. It basically is (at the time of writing this article):
- iPhone 3G/iPod3: 480×320
- iPhone 4/iPo4: 960×640
- iPad 1,2: 1024×768
- iPad 3 (or “new iPad”…): 2048×1536
CCFileUtils::setiPadSuffix("-mysufix"); CCFileUtils::setiPadRetinaDisplaySuffix("-mysufix"); CCFileUtils::setiPhoneRetinaDisplaySuffix("-mysufix");
BUG: The problem comes when you want to create a game for iPad only. Cocos2D-X will always look for xxx.yyy file. This means that having your xxx.ipad.yyy and xxx.ipadhd.yyy is not enough, and if you don’t put the xxx.yyy file in the project, the execution will fail.
Then, the next interesting thing is about positioning. All the small devices share a device width and heigh of 480×320 points, so you can use the same absolute positioning for them if you want. iPad and iPad hd will also share the 1024×760 points.
I don’t like relative positionings… I prefer to control where is everything on the screen. But anyway, if anyone finds a good solution to use the same positioning system for iPhone and iPad please let me know
Please feel free to follow me on twitter and share your thoughts @jboschaiguade