Search code examples
iossprite-kittiled

Correct image size for iPhone developing


I am working on an iPhone game in spritekit, for the past while I have been using random graphics but as my game play is beginning to shape up. I think it's time I look into my own graphics development.

My level is designed in Tiled, So I would like to know if it is ok to make each tile 16 * 16 and the hd version ( for the iPhone retina) 32 * 32. and, what is the difference in drawing images for iPhone and iPhone retina.

Thank you


Solution

  • That's correct. Retina graphics twice the resolution of non-retina. The easiest way to support both retina and non-retina displays is to make two copies of each graphic you use. Use the format imagename.png for the non-retina and [email protected] for the retina image. When you want to load the image you can use this line:

    UIImage* image = [UIImage imageNamed:@"imagename"];
    

    iOS will automatically select the correct image.