加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

在Swift游乐场无法加载纹理图集?

发布时间:2020-12-14 04:27:42 所属栏目:百科 来源:网络整理
导读:好吧,过去我只是通过键入其名称将SKTextureAtlas加载到我的班级,但是现在在 Swift游乐场中我尝试添加几个扩展名(.atlas,.spriteatlas,没有扩展名……)和其他所有内容,但是我得到了错误: Texture Atlas 'testAtlas' cannot be found. 这就是我得到这个: ove
好吧,过去我只是通过键入其名称将SKTextureAtlas加载到我的班级,但是现在在 Swift游乐场中我尝试添加几个扩展名(.atlas,.spriteatlas,没有扩展名……)和其他所有内容,但是我得到了错误:

Texture Atlas 'testAtlas' cannot be found.

这就是我得到这个:

override init(texture: SKTexture!,color: NSColor!,size: CGSize) {
        super.init(texture: texture,color: color,size: size)

        atlas = SKTextureAtlas(named: "testAtlas")
        print(atlas.textureNames) //to test if got it
    }

我认为这是一个问题,他们不是在操场上的目标,但我把它放入我的资源文件夹,它应该能够识别图集:

enter image description here

如何在Swift 3的游乐场中获得纹理图集?

解决方法

尝试将文件夹的名称更改为testAtlas.atlas

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读