Search code examples
iphoneresolutioniphone-5

Iphone 5 game resolution


I have a developer working on a game for me for ios for iPhone 5. He stated the resolution we must use for the game is 320 x 568, but the iphone 5 has a resolution of 640 x 1136 and he stated that this is the resolution for the graphics and not the game leveling design. The game is a 2D maze game.

I am still learning, so any help would be greatly appreciated. Which resolution is the correct resolution? Why is it half of what apple states?

Thanks in advance


Solution

  • Here's the story. When Apple introduced the iPhone 4, it introduced the "Retina Display". That is, the iPhone 4 had a screen with twice as many pixels on it than the previous iPhones. So to compensate, Apple came up with the screen points system. It works like this:

    -On non-retina devices, 1 point = 1 pixel -On retina devices, 1 point = 2 pixels

    -On any device, the programmer's coordinates are done in points. -On any device, the art assets should be done using pixels

    Example: I have a 200x200 pixel image used on retina devices. When I load the image into a view, the size of the view is 100x100 points.

    In order to make sure your image is loaded properly, you have to use the @2x suffix. If you have a 200x200 pixel image "myImage.png", it will be loaded as 200x200 points and will be scaled up on retina devices. If instead you name the image "[email protected]", instead it will interpret the image as 100x100 points, and will scaled down on non-retina devices. You can also have two versions of an image (Apple recommends 2 images although it isn't strictly necessary). If you have both 100x100 pixel "myImage.png" and 200x200 pixel "[email protected]", it will interpret them as two versions of the same image, and will use the @2x one on retina devices and the other one on non-retina devices. In both cases, the image will be interpreted as 100x100 points.

    You might also want to take a look at Apple's High Resolution Guide.