Question

I'm attempting to use multipacking via TexturePacker to handle multiple animations for the same sprite. I added all my images in TexturePacker and published them, no problem. I've added them to the Resources folder in my project and I even see them in Finder.

Resources folder

When I attempt to call this

-(CCSpriteBatchNode*)createSpritesheet {
    [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"Clea1.plist"];

    CCSpriteBatchNode *spritesheet = [CCSpriteBatchNode batchNodeWithFile:@"Clea1.png"];

    return spritesheet;
}

I wind up with the following errors:

2013-08-21 00:08:13.024 HFZ[10498:a0b] -[CCFileUtils fullPathForFilename:resolutionType:] : cocos2d: Warning: File not found: Clea1.plist
2013-08-21 00:08:13.025 HFZ[10498:a0b] cocos2d: CCSpriteFrameCache: Trying to use file 'Clea1.png' as texture
2013-08-21 00:08:13.025 HFZ[10498:a0b] -[CCFileUtils fullPathForFilename:resolutionType:] : cocos2d: Warning: File not found: Clea1.png
2013-08-21 00:08:13.026 HFZ[10498:a0b] cocos2d: Couldn't find file:Clea1.png
2013-08-21 00:08:13.026 HFZ[10498:a0b] cocos2d: CCSpriteFrameCache: Frame 'CleaStand00.png' not found

I really don't understand why this is happening. Before I tried the multipack solution, I was attempting to use one spritesheet per animation, but this seemed like the better route to go. Any ideas on this?

Was it helpful?

Solution

Just guessing, but sometimes it happens to me that even when I add resources to the project, they don't appear in the Copy Bundle Resources Build Phase. Double-check that Clea1.plist and Clea1.png are on your Copy Bundle Resources section, otherwise drag them from the Project navigator

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top