This is how I create a sprite with texture form a sprite-sheet. But how do I change the sprites texture later on?
I have tried using setTexture
but I can t get i working.
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"gameSpriteSheet.plist"];
CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@"gameSpriteSheet.png"];
[self addChild:spriteSheet];
// Add hangman graphic sprite to Scene
playerSprite = [CCSprite spriteWithSpriteFrameName:@"playerX"];
playerSprite.position = ccp(580, 400);
[self addChild:playerSprite];