Questions tagged [sktextureatlas]

An SKTextureAtlas object is a collection of related texture objects created from a texture atlas stored inside the app bundle

SKTextureAtlas is only available in iOS7.0 or later.

Tag questions if your question address one of the following issues:

  • Converting code where sprites are drawn with different textures to using an Atlas
  • Creating a Texture Atlas
  • Creating a Texture from a Texture Atlas
  • Preloading Texture Atlas Data
  • Inspecting the Texture Atlas
  • Adding artwork to the .atlas folder

Apple developer documentation

75 questions
22
votes
2 answers

CUICatalog: Invalid Request: requesting subtype without specifying idiom (Where is it coming from and how to fix it?)

When I run my SpriteKit game, I receive this error multiple times in the console. As far as I can tell (though I'm not completely sure), the game itself is unaffected, but the error might have some other implications, along with crowding the debug…
15
votes
3 answers

How to make Sprite Kit display @2x images from atlas at correct size?

When a project only has @2x images because it only targets retina display devices, atlas Sprite Kit atlas gets the scale wrong with the RGBA8888_COMPRESSED setting to use with PVR textures. RGBA8888_PNG (the default) sometimes works ok. Before…
openfrog
  • 40,201
  • 65
  • 225
  • 373
13
votes
5 answers

Spritekit - not loading @3x images from SKTextureAtlas

Since my sample project was deleted (I thought this would be much easier to test), I will post some code and images to illustrate my point. Here are sample images My atlas setup: My launch image setup: The code where I add these sprites to my…
hamobi
  • 7,940
  • 4
  • 35
  • 64
11
votes
1 answer

How does SKTexture caching and reuse work in SpriteKit?

It is often mentioned on StackOverflow that SpriteKit does its own internal caching and reuse. Does Sprite Kit load a texture atlas multiple times if I use SKTextureAtlas later? should I cache textures in properties in sprite kit? SpriteKit memory…
Karl Voskuil
  • 750
  • 6
  • 19
8
votes
1 answer

SpriteKit: performance hit while preloading SKTextureAtlas

I'm experiencing a performance hit when preloading SKTextureAtlas: let textureAtlas = SKTextureAtlas(named: atlasName) textureAtlas.preload(completionHandler: { ... }) By performance hit, I mean FPS dropping to ~50 for a short amounts of…
damirstuhec
  • 6,069
  • 1
  • 22
  • 39
7
votes
1 answer

Render nodes in single drawing pass with spritekit?

As I was looking around for information about spritekit textures, and I stumbled upon this quote: If all of the children of a node use the same blend mode and texture atlas, then Sprite Kit can usually draw these sprites in a single drawing pass.…
IAmTheAg
  • 351
  • 3
  • 11
6
votes
0 answers

SKSpriteNode lighting doesn't work with textures from SKTextureAtlas

I ran into a problem with SpriteKit (tried Xcode 7 beta and Xcode 6.4 on OS X 10.11 beta) where normal-mapped lighting breaks down if I create a SKTextureAtlas from the image and normal files that work when used individually. See this example: From…
CodeSmile
  • 64,284
  • 20
  • 132
  • 217
5
votes
1 answer

Using a sprite atlas, texture atlas, or asset catalog in SpriteKit projects

Apple's recommended way for organizing assets in a SpriteKit project has changed greatly over the course of the engine's history. There have also been bugs in the old methodology which stymied the implementation of these practices and required…
peacetype
  • 1,928
  • 3
  • 29
  • 49
5
votes
0 answers

Memory leak in SKTextureAtlas preloadWithCompletionHandler using XCODE 8.0

I hope someone can help me find an answer to this problem. I filed a bug report to apple a few weeks ago (28684035) but they have not responded to my report yet. The apple forum is no help either. My game is in development and it sometimes crashes…
5
votes
4 answers

How to use pixel art in an app?

I have an iOS app that uses sprite kit, and I am ready to add my artwork. The artwork is pixel-art and is inherently very small. I am trying to find the best way to display this in way where: All of the art is the same size, meaning that one image…
67cherries
  • 6,931
  • 7
  • 35
  • 51
4
votes
1 answer

iOS, SpriteKit convert SKTextureAtlas/SKTexture into UIImage

I'm trying to retrieve UIImage from SKTexture where SKTexture comes from an SKTextureAtlas. Which make is harder due to the fact .cgImage() isn't working on Atlases. Anyway, I've came up with solution to use CoreGraphic, however, that seems not to…
Shial
  • 1,386
  • 19
  • 31
4
votes
1 answer

Can't load texture atlas in Swift playground?

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…
blue
  • 7,175
  • 16
  • 81
  • 179
4
votes
1 answer

Can SKTextureAtlas load bundle from "my" bundle instead of "host" bundle?

I'm working on a SWIFT3/SpriteKit screensaver and I had the screensaver working except I cannot get my texture to load because when I do the following: // load texture atlas let textureAtlas = SKTextureAtlas(named: "Flyers") The SKTextureAtlas is…
Mavro
  • 571
  • 8
  • 19
4
votes
1 answer

Free SKTextureAtlas From Memory

I have a problem getting a texture atlas to free. Currently I have a SpriteKit game where a player can change his character. Right now I have the atlas's in a Global shared instance like so. let char0Atlas: SKTextureAtlas = SKTextureAtlas(named:…
datWooWoo
  • 843
  • 1
  • 12
  • 42
3
votes
1 answer

Swift : How to handle a lot of textures in memory

I have a lot of characters in my game and because of that I have so many textures. When a texture atlas is loaded (containing about 5 different image textures) it increases the memory use and keeps it there at that amount. So the more textures just…
1
2 3 4 5