未findSpriteBuilder映像文件
我在精灵生成器资源文件夹中添加了一个.png图像,并发布了它。
我在Published-IOS下的Resources下的Sprite builder all文件夹中看到添加的图像。
在这里,我试图通过以下方式访问添加的图像。
-
_hero.spriteFrame = [CCSpriteFrame frameWithImageNamed:@"Down.png"];
-
[_hero setTexture:[CCTexture textureWithFile:@"Game/Down.png"]]
但是这些方法都没有工作。
它显示错误日志为。
-[CCFileUtils fullPathForFilename:contentScale:] : cocos2d: Warning: File not found: Down.png
请帮我解决这个问题。一个使用这个精灵build造者的新手。
将@"Down.png
”更改为@"Resources/Down.png"
因为您必须将SpriteBuilder中创build的文件夹包括在SpriteBuilderpipe理的资源文件中。
同样,如果您在名为“Levels”的子文件夹中有some.ccb,则必须使用string@"Levels/some.ccb"
加载它。