Search code examples
iossprite-kitatlas

Accessing sprite atlas from screen that is not an SKScene


I have a SpriteKit game that accesses the sprite atlas images without issue.

However, in some of my menus I am using standard iOS UI components like table views and collection views. For those screens I lay out everything on a standard UIView controller.

However, on these screens I am not able to access the images unless I add those images to a separate folder which is not ideal.

How can I access them from the texture atlas? Thanks


Solution

  • You can't. Add these images separately, whether you also need to add these images to a Sprite Kit atlas depends on whether the game's performance suffers if you don't. There's currently no practical way to extract individual images from a SKTextureAtlas.