Well, in the past I loaded SKTextureAtlas into my class just by typing its name, however now on Swift playgrounds I tried to add several extensions (.atlas, .spriteatlas, no extension ..) and everything else, however I get an error message:
Texture Atlas 'testAtlas' cannot be found.
Here is how I get it:
override init(texture: SKTexture!, color: NSColor!, size: CGSize) {
super.init(texture: texture, color: color, size: size)
atlas = SKTextureAtlas(named: "testAtlas")
print(atlas.textureNames)
}
I think this is a problem with the fact that they are not a goal on the playground, but I put it in the resources folder and it should recognize the atlas:

How can I get a texture atlas on playgrounds with Swift 3?
source
share