【问题标题】:Can't load texture atlas in Swift playground?无法在 Swift 操场上加载纹理图集?
【发布时间】:2017-03-25 17:24:50
【问题描述】:

好的,过去我只需输入名称即可将 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
    }

我认为这是他们在操场上没有目标的问题,但是我已将其放入资源文件夹中,它应该能够识别图集:

如何使用 Swift 3 在 Playground 中获取纹理图集?

【问题讨论】:

  • 1年过去了,这个问题还没有解决!

标签: swift swift3 swift-playground sktextureatlas


【解决方案1】:

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

【讨论】:

  • 请编辑您的答案,解释为什么以及如何解决问题。
猜你喜欢
  • 2016-12-10
  • 2020-02-21
  • 2015-10-08
  • 2012-10-03
  • 2014-12-28
  • 1970-01-01
  • 1970-01-01
  • 2018-11-18
  • 2018-02-08
相关资源
最近更新 更多