I just switched the textures in my SpriteKit game to using a Sprite Atlas. It is all working fine when I test on the Simulator, but on my connected actual iPhone, it does not. All textures in the atlas display in a sort grid pattern, shrunken and warped to fit the SKShapeNode.
Here is the code I'm using
let spriteTextureAtlas = SKTextureAtlas(named: "Sprites")
override func sceneDidLoad() {
spriteTextureAtlas.preload {}
func spriteCreator() -> SKShapeNode{
sprite = SKShapeNode.init(circleOfRadius: 20)
sprite.fillTexture = spriteTextureAtlas.textureNamed("spriteTexture")
return sprite
}
I'm sure it is some stupid mistake, but cannot figure out what.
Thanks for the help!
UPDATE
I'm only working with 5 totally seperate textures. If I create a new atlas for every texture, it works fine. This seems inefficient? Or is this what I should be doing, as these textures are not frames of the same animation.