cocos2d-iphonecocos2d-iphone-3

Cocos2d v3 Image Naming Conventions


I'm migrating my apps from cocos2d v2.x to v3.x, first of all I'm not going to use spritebuilder. so in 2.0 there were 4 different resolutions for every sprite.

sprite.png/iphone sprite-hd.png/iphone retina sprite-ipad.png/ipad sprite-ipadhd.png/ipad retina

the same approach as i see is not working for v3.0,the question is, what is the solution for v3.0? also tried to add the following code manually in app delegate, but no result

[[CCFileUtils sharedFileUtils] setiPadRetinaDisplaySuffix:@"-ipadhd"];
    [[CCFileUtils sharedFileUtils] setiPadSuffix:@"-ipad"];
    [[CCFileUtils sharedFileUtils] setiPhoneRetinaDisplaySuffix:@"-hd"];

Solution

  • Found solution. To use custom sprites with spritebuilder , I've moved all my sprites to ccbResources folder and put them into appropriate subfolders. then to acces them I'm using [CCSprite spriteWithImageNamed:@"ccbResources/sprite.png"];