Hi all. I'm trying to use more than one sprite sheet because I can't fit them all on one and having two makes my ordering them easier (sprite sheet one sprites are in the back and have a lower zOrder). I'm currently doing:
spriteSheet1 = [[CCSpriteSheet spriteSheetWithFile:@"spriteSheet1.png" capacity:3] retain];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"spriteSheet1.plist"];
[self addChild:spriteSheet1];
spriteSheet2 = [[CCSpriteSheet spriteSheetWithFile:@"spriteSheet2.png" capacity:4] retain];
[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"spriteSheet2.plist"];
[self addChild:spriteSheet2];
CCSprite *sprite = [CCSprite spriteWithSpriteFrameName:@"sprite1.png"];
The last line crashes with the error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid spriteFrame for sprite' SIGABRT
Am I not allowed to cache more than one sprite sheet? If not, is there another efficient way to handle this?