CCSpritesheet and spriteframebyname is undefined

CCSpritesheet and spriteframebyname is undefined
0.0 0


using cocos2d-x for android. can figure out why I can get this to go forward.

Been tring to follow the code for plist, but are still having an issue.

Im getting an error where the X’s are:

the addChild(spritesheet); CCSpritesheet is undefined for the type

CCSpriteFrame frame = CCSpriteFrameCache.spriteFrameByName(“bear” + i + “.png”); spriteframebyname is undefined for CCSpriteFramecache

Full code below

CGSize s = CCDirector.sharedDirector().winSize();
CCSprite sprite = CCSprite.sprite(“bear1.png”, true);
sprite.setPosition(s.width/2, s.height/2);

CCSpriteSheet spritesheet = CCSpriteSheet.spriteSheet(“AnimBear.png”);
X addChild(spritesheet);

ArrayList animFrames = new ArrayList();
for(int i = 1; i <= 8; i++){
X CCSpriteFrame frame = CCSpriteFrameCache.spriteFrameByName(“bear” + i + “.png”);
CCAnimation animation = CCAnimation.animation(“Bear”, 0.2f, animFrames);
CCAction action = CCRepeatForever.action(CCAnimate.action(animation, false));

What are we doing wrong? Thanks for any advice…


CCSpriteSheet is renamed to CCSpriteBatchNode since cocos2d-iphone 0.99.5 & cocos2d-0.99.5.-x-0.7.2.


Thanks, that gave us some more insite, but we are using cocos2d-android-1 which is still a bit behind. From looking at the classes, SpriteFramebyName isn’t listed… any what to import that from somewhere else? Just looking for a way to move forward…



CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(const char*) is still existing.