Search code examples
iphonecocos2d-iphoneiphone-4

Upgrading a cocos2d iPhone game to work at iPhone4 resolution using @2x


I am trying to add art to my game for the iPhone4 resolution. The images i am using are twice the original and i have added the @2x suffix to the image names.

When i load in a sprite like this:

 [CCSprite spritewithFile:@"example.png"];

where example.png is the original image and [email protected] is the scaled up version. When running on the original iPhone it loads the low res image and when running on the iPHone4 it loads the high res image, but it doubles the size of the image. So the high res image appears the same on the iPhone4 as on the original iPhone. Each pixel on the image takes up 4 pixels on the screen.

Any idea why this might be happening? Is there something I am supposed to do to tell the app not to double the size of the art?


Solution

  • Have you read the "Retina Display in cocos2d" section of the cocos2d for iPhone wiki? (It pretty much tells you all you need to know.)