【发布时间】: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