I’m trying to get started with cocos2d by creating an app with a background image. It’s not a texture, just a straight image.
I add the background using:
CCSprite* background = [CCSprite spriteWithFile:@"paris.png"];
background.tag = 1;
background.anchorPoint = CGPointMake(0, 0);
[self addChild:background z:0];
The image is 960×640 but when I run it in the iPhone 5 simulator I only see a small part of the image. It’s like it’s too large for the screen. I was under the impression I would need 960×640. Is this not accurate? What resolution should my image be?
I’ve tried with and without the anchorPoint being set. Without the anchor I see a smushed image on 1/2 the screen.
Learn about retina display in cocos2d: http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:how_to_develop_retinadisplay_games_in_cocos2d
Make an image with 480×320 with name paris.png…
Rename your current image as paris-hd.png…
Enable Retina Display in app delegate.. And you are done.. Hope this helps.. 🙂