Cocos2d tagged posts

A quick tip regarding -hd resources in Cocos2d

When enabled, Cocos2d supports automatic loading of standard and Retina based images and textures based on whether the filename has a -hd suffix before the extension  (ie, MySpriteSheet-hd.png).  If the filename doesn’t contain a -hd, it will be treated as a “standard” resolution file.  In code, when loading a texture or image, you use a filename that does not include the -hd suffix.  Here’s an example of code to load a background image.  I have two versions of Background.png.  One named Background.png, and the other named Background-hd.png.  Cocos2d will automatically load the correct version based on whether or not the device has a Retina display or not.

// Add main background to scene
CGSize winSize = [CCDirector sharedDirector].winSize;
self...
Read More