在Cocos2d中加载multipack spritesheet时找不到文件

时间:2013-08-21 04:30:44

标签: ios cocos2d-iphone texturepacker

我试图通过TexturePacker使用多包装来处理同一个精灵的多个动画。我在TexturePacker中添加了所有图像并发布了它们,没问题。我已将它们添加到项目的Resources文件夹中,我甚至在Finder中看到它们。

Resources folder

当我试图调用此

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

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

    return spritesheet;
}

我结束了以下错误:

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

我真的不明白为什么会这样。在我尝试multipack解决方案之前,我试图在每个动画中使用一个spritesheet,但这似乎是更好的路线。关于这个的任何想法?

1 个答案:

答案 0 :(得分:3)

猜测,但有时我发现,即使我向项目添加资源,它们也不会出现在Copy Bundle Resources Build Phase中。仔细检查Clea1.plist部分是否Clea1.pngCopy Bundle Resources,否则请将其从Project navigator

中拖出

enter image description here