0
votes

I was trying to write a bullet class and bulletCache for a project I've been working on, and I was using CCSpriteBatchNode. It wasn't declaring, so I tried all sorts of #imports and @class attempts, and then I realized the class must not exist, and it did not!

I have the CCSpriteBatch code from another project, so I created a new class (both a .h and .m file) within the cocos2d folder, and copy pasted the code over.

A compile error alerted me to the fact that CCSpriteBatchNode was missing a structUpdate method in CCSprite. This alerted me to the fact that the cocos2d code is markedly different between the two CCSprite.h/m files.

Is it possible that this new project's cocos2d files didn't have CCSpriteBatchNode because it's use has been replaced by CCSpriteFrame?

1
CCSpriteBatchNode is declared in CCSpriteBatchNode.hUltrakorne

1 Answers

1
votes

CCSpriteFrame and CCSpriteBatchNode are two different classes. CCSpriteFrame serve as data classes defining the region of a texture that should be displayed by a frame.

Merely adding or copying a single class from one version of cocos2d to another is likely to fail. Your best option is to entirely replace cocos2d with the latest version by installing the latest version's Xcode templates, then create a new Cocos2D project and add your project's source code and resource files to the new project.

Note that in your project CCSpriteBatchNode may be known under its previous name CCSpriteSheet.