greg rock
greg rock

Reputation: 239

How to replace CCSpriteSheet by CCSpriteBatchNode

So I have created a CCSpriteSheet :

_spriteSheet = [[CCSpriteSheet spriteSheetWithFile:@"deuximages2.png" capacity:2] retain];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"deuximages2.plist"];

in another method :

 mangeur = [CCSprite spriteWithSpriteFrameName:@"mangeurcentremieu_03.png"];

but I have the warning : CCSpriteSheet is deprecated. I think that I have to replace it by CCSpriteBatchNode but I don't know how to do it .

Upvotes: 1

Views: 699

Answers (1)

Hailei
Hailei

Reputation: 42163

CCSpriteBatchNode's interfaces are basically the same as CCSpriteSheet. I remember CCSpriteBatchNode was introduced in 0.99.5 to replace CCSpriteSheet.

_batchNode = [[CCSpriteBatchNode batchNodeWithFile:@"deuximages2.png" capacity:2] retain];

Upvotes: 2

Related Questions