Organize SpriteKit Artwork with Asset Catalogs and Texture Atlases
Keep editor image names and runtime texture names in agreement.
Follow along with the downloadable Desert Ruins iOS demo. Source references in this article point to Desert Ruins iOS Demo/DesertRuins/LevelData.swift. Code excerpts use the sample’s existing types and properties.
Why artwork can disappear at runtime
A PNG visible in the editor can still be missing from the game if its catalog name or target membership differs. Animation sequences also need their frames in the right order. Treat the editor’s image reference and the game’s asset resolver as a shared naming contract.
Understand the sample’s naming convention
The included import-art.py script generates category-prefixed asset names. A Characters sequence named dune_explorer_Idle becomes Characters_dune_explorer_Idle in the catalog. LevelData.catalogName adds the category prefix when resolving a level reference. Preserve that mapping when replacing art.
Load an animation through the scene cache
LevelData.animation verifies that the named atlas contains textures and retrieves its frames through AppSharedSceneBase.retrieveTexture. The excerpt lives inside that method, where asset is the resolved category-prefixed name and scene is the game’s scene. Loading frames during character setup keeps that work out of the update loop.
With the frames loaded, see how to switch between idle, run, jump, and attack animations in SpriteKit.
Share images with the editor
LevelEditor’s File → Manage Image Sources lets you link folders, source asset catalogs, and SpriteKit atlas folders. Assign the relevant category and choose animation or individual-image interpretation. When using an existing catalog directly, keep its names aligned with the demo resolver.
Regenerate a catalog deliberately
The command below runs the import script directly from the extracted Resources folder. It replaces the generated LevelArt.xcassets, so use a copy if you have hand-edited that catalog. Check target membership in Xcode and run the game after importing. Validate one static image and one full animation before replacing the rest of the art.
python3 "Desert Ruins iOS Demo/import-art.py" "Desert Ruins Workspace/Assets/Images" "Desert Ruins iOS Demo/DesertRuins/LevelArt.xcassets"
Where Scroller2d saves work
When LevelEditor and the app agree on the asset names, the same placed object can resolve its image or animation atlas across levels. The sample’s sync script handles the asset catalog import and the SDK’s scene cache reuses atlas textures. You still choose how assets are organized and mapped.