【问题标题】:SpriteBuilder image file not found未找到 SpriteBuilder 图像文件
【发布时间】:2014-06-25 13:31:37
【问题描述】:

我在 sprit builder 资源文件夹中添加了一个 .png 图像并已发布。

我在 Published-IOS 下的 Resources 中的 sprite builder 所有文件夹中看到添加的图像。

这里我尝试通过以下方式访问添加的图像。

  1. _hero.spriteFrame = [CCSpriteFrame frameWithImageNamed:@"Down.png"];

  2. [_hero setTexture:[CCTexture textureWithFile:@"Game/Down.png"]]

但是这些方法都不起作用。

它在日志中显示错误。

 -[CCFileUtils fullPathForFilename:contentScale:] : cocos2d: Warning: File not found: Down.png

请帮我解决这个问题。我是使用此 sprit builder 的新手。

【问题讨论】:

  • 图片在哪个文件夹?包括大写/小写在内的确切名称是什么?
  • @LearnCocos2D 请在编辑中找到我的附件图片

标签: ios cocos2d-iphone spritebuilder


【解决方案1】:

@"Down.png" 更改为 @"Resources/Down.png",因为您必须包含在 SpriteBuilder 中创建的文件夹,以供对 SpriteBuilder 管理的资源文件的任何引用。

同样,如果您在名为“Levels”的子文件夹中有 some.ccb,则必须使用字符串 @"Levels/some.ccb" 加载它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-09
    • 1970-01-01
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 2017-05-18
    • 2013-04-30
    • 2020-11-09
    相关资源
    最近更新 更多