SKTextureAtlas
A collection of textures optimized for storage and drawing performance.
Declaration
class SKTextureAtlasMentioned in
Overview
An SKTextureAtlas is a collection of textures that were either created from an .atlas folder in the app bundle, or created at runtime. Texture atlases improve memory usage and rendering performance by reducing draw calls. Whenever you have textures that are always used together, store them in an atlas for best results.
SpriteKit implicitly loads an atlas when one of the atlas’s textures is accessed. Use textureNamed(_:) when you want to explicitly access a texture atlas’s contents.
The preferred place to create a texture atlas is within an asset catalog (see Creating a Sprite Atlas), but you can also put your source textures in an .atlas folder in the app bundle.
Topics
First Steps
Accessing Textures
Creating a Texture Atlas Programmatically
Preloading Textures
preload(completionHandler:)preloadTextureAtlases(_:withCompletionHandler:)preloadTextureAtlasesNamed(_:withCompletionHandler:)