Archive for the ‘plist’ Category

Creating Frame Animation in Cocos2d-X 2.0 Using a Sprite Sheet

Saturday, July 28th, 2012

Since the Cocos2d-X 2.0 rc2 a lot of the initialisation has changed so this code works in Cocos2d-X 2.0.

First create a sprite sheet so we can load it in.

Once you have created the Sprite Sheet you will end up with a image file and plist.

mySprites.png
mySprites.plist

I like to name my sprites like this:

jumpAnimation_00
jumpAnimation_01
jumpAnimation_02
jumpAnimation_03
jumpAnimation_04
jumpAnimation_05

walkAnimations_00
walkAnimations_01
walkAnimations_02
walkAnimations_03
walkAnimations_04
walkAnimations_05

It makes creating the animations easier. My code below is depended on the above naming convention.

cocos2d: WARNING: format is not supported for CCSpriteFrameCache

Monday, September 13th, 2010

I have been working away at same iPhone game development.

I found a nice sprite sheet editor zwoptex: http://zwoptexapp.com which is compatible with the engine I was using cocos2d: http://code.google.com/p/cocos2d-iphone/

Little did I know there was some version issues between the exporter and the engine. Zwoptex exports a png and a plist that contains all the meta-data for the sprite sheet. If you are getting the bellow mentioned error you might be reading online various suggestions like installing older versions of zwoptex or a new versions of the  engine.

Solution:

As it turns out all you have to do is un-check  rotate from inside zwoptex publish the files. Edit the plist generated by zowptex and change the root>>metadata>>format number from 2 to 1 save clean your build recompile and your done.

cocos2d error:

ocos2d: WARNING: format is not supported for CCSpriteFrameCache addSpriteFramesWithDictionary:texture:

Full Error:

Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘cocos2d: WARNING: format is not supported for CCSpriteFrameCache addSpriteFramesWithDictionary:texture:’
2010-09-13 16:01:36.353 TileMap[12915:40b] Stack: (
46889040,
48046892,
46626571,
4768532,
450434,
452386,
10372,
298606,
9808,
8936,
8317326,
8321359,
8346942,
8328439,
8360408,
57418108,
46168220,
46164136,
8319521,
8352626
)