SpriteBuilder image file not found(未找到 SpriteBuilder 图像文件)
问题描述
我在 sprit builder 资源文件夹中添加了一个 .png 图像并已发布.
I have added a .png image in sprit builder resource folder and I have published it.
我在 Published-IOS 下的 Resources 中的 sprite builder 所有文件夹中看到添加的图像.
I see the added image in sprite builder all folder in Resources under Published-IOS.
这里我尝试通过以下方式访问添加的图像.
Here I have tried to access the added image in following ways.
_hero.spriteFrame = [CCSpriteFrame frameWithImageNamed:@"Down.png"];
[_hero setTexture:[CCTexture textureWithFile:@"Game/Down.png"]]
但是这些方法都不起作用.
But none of these methods are working.
它在日志中显示错误.
-[CCFileUtils fullPathForFilename:contentScale:] : cocos2d: Warning: File not found: Down.png
请帮我解决这个问题.我是使用此 sprit builder 的新手.
Please help me with this to resolve.Am a newbie using this sprit builder.
推荐答案
把 @"Down.png" 改成 @"Resources/Down.png" 因为你有包括在 SpriteBuilder 中创建的文件夹,用于对 SpriteBuilder 管理的资源文件的任何引用.
Change @"Down.png" to @"Resources/Down.png" because you have to include the folders created in SpriteBuilder for any references to resource files managed by SpriteBuilder.
同样,如果您在名为Levels"的子文件夹中有 some.ccb,则必须使用字符串 @"Levels/some.ccb" 加载它.
Likewise if you had some.ccb in a subfolder named "Levels" you'd have to load it with the string @"Levels/some.ccb".
这篇关于未找到 SpriteBuilder 图像文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:未找到 SpriteBuilder 图像文件
基础教程推荐
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
