2013-08-21 69 views
1

我試圖通過TexturePacker使用multipacking來處理同一個sprite的多個動畫。我在TexturePacker中添加了所有圖像併發布了它們,沒有問題。我已經將它們添加到我的項目的Resources文件夾中,我甚至可以在Finder中看到它們。在Cocos2d中加載multipack spritesheet時找不到文件

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,但這似乎是更好的路線。對此有何想法?

回答

3

只是猜測,但有時發生在我身上,即使我將資源添加到項目中,它們也不會出現在Copy Bundle ResourcesBuild Phase中。仔細檢查Clea1.plistClea1.png對你的Copy Bundle Resources部分,否則從Project navigator

enter image description here

拖動
相關問題