I've recently tested an OpenGL ES based 2D game on the iPhone 4. I've done almost all of the development and testing so far on my 3G device. The game works fine (except for a few multitasking things) on the new device. I'd like to replace some of the artwork w/ "better" artwork that takes advantage of the iPhone 4's higher resolution. How can I do this?

Is there a flag somewhere that tells the phone to scale up some or all of the image resources?

  • \$\begingroup\$ I assume you have artwork that is actually of a higher resolution? Or would you just be scaling up the lower-resolution ones? \$\endgroup\$
    – Smashery
    Commented Jul 26, 2010 at 0:56
  • \$\begingroup\$ Yes I have artwork of a higher resolution. Currently when I save a 100x100 pixel png-24 it appears as 100x100 pixels on the 3G device... and 200x200 pixels on the iPhone 4. I'd like to actually save a 200x200 image and use that on the iPhone 4 (and the 100x100 on the 3G). \$\endgroup\$
    – MrDatabase
    Commented Jul 26, 2010 at 2:42

1 Answer 1


Apple's Documentation: Supporting High-Resolution Screens (requires iPhone developer account)

Some basics:

  • Add "@2x" to your filenames for high resolution files. So you'd have myTexture.png for low-res and [email protected] for high-res.
  • If you're using UIImage to load in graphics, imageNamed:, imageWithContentsOfFile:, and initWithContentsOfFile: will automatically look for @2x files on the iPhone 4. Otherwise you have to load them yourself.
  • For OGL ES change the "contentScaleFactor" property of your view from 1.0 to 2.0 to increase the size of the renderbuffer.

There's more to it than that depending on what you're drawing and how you're drawing it. The docs are super handy in that regard.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .