I get the following error: 'CCSprite is not using the same texture id'
This is what I’m doing:
.h file
@interface GameplayLayer : CCLayer <GameplayLayerDelegate> {
CCSpriteBatchNode* pointbb;
}
.m file
pointbb = [CCSpriteBatchNode batchNodeWithFile:@"pointsbb.png"];
[self addChild:pointbb];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"pointsbb.plist"];
CCSprite* spa = [CCSprite spriteWithSpriteFrameName:@"poi2500001.png"];
[pointbb addChild:spa];
The exact syntax worked for other animations but this one. What should be my correct course of action?
If you are adding a
CCSpriteas a child ofCCBatchNode.. use textures from batchnode..Use this method..
In case you add your sprite to layer like
[self addChild:].. Your code will perfectly..Hope this helps. 🙂