4

Alright, in the past I have loaded a SKTextureAtlas into my class simply by typing its name, however now in Swift playgrounds I have tried adding several extensions (.atlas, .spriteatlas, no extension..) and everything else, however I am getting the error:

Texture Atlas 'testAtlas' cannot be found.

This is how I am getting this:

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
    }

Im thinking this is a problem with their being no target in a playground however I have put it into my resources folder and it should be able to recognize the atlas:

enter image description here

How can I get a texture atlas in playgrounds with Swift 3?

blue
  • 7,175
  • 16
  • 81
  • 179

1 Answers1

0

Try to change the name of your folder to testAtlas.atlas

Igor Dvorzhak
  • 4,360
  • 3
  • 17
  • 31