SpriteKit API Reference
A SpriteKit API reference organized by category, from node types and physics through actions, textures, particles, Metal rendering, and SwiftUI embedding. Use it when you know what you want to build and need the exact API.
When to Use This Reference
Use this reference when:
- Looking up specific SpriteKit API signatures or properties
- Checking which node types exist and how each one performs
- Choosing a physics body creation method
- Finding the right
SKActionfor an animation - Configuring
SKEmitterNodeparticle properties - Setting up
SKViewdebug overlays, scale modes, or transitions - Looking up
SKConstrainttypes - Writing an
SKShaderor rendering withSKRenderer - Embedding a scene in SwiftUI with
SpriteView
Example Prompts
Questions you can ask your assistant that will draw from this reference:
- "How do I create a physics body from a texture?"
- "What
SKActiontypes are available for movement?" - "What properties does
SKEmitterNodehave?" - "How do I set up
SKRendererfor Metal?" - "What are the
SKViewdebug overlay options?" - "What particle settings create a fire effect?"
- "How do I share game state between SwiftUI and my
SKScene?"
What's Covered
Node Hierarchy
- 16 node types, each with its purpose, whether it batches, and performance notes
SKSpriteNodeproperties: anchor point, color blend, normal maps and lighting, shadersSKLabelNodeproperties: font, alignment, multiline text
Physics
- Body creation: circle, rectangle, polygon, texture, compound, and edge bodies
- Body properties: bitmasks, mass and density, friction, restitution, damping, velocity
- Forces, impulses, and torque
SKPhysicsWorld: gravity, speed, contact delegate, ray casting- 5 joint types: pin, fixed, spring, sliding, limit
- Field types: linear gravity, radial gravity, electric, noise, vortex, drag
Action Catalog
- Movement, rotation, scaling, fading, composition, texture and color, sound, node tree, physics
- Timing modes and
speed
Textures and Atlases
SKTexturefrom an image, an atlas, a subrectangle, or aCGImage- Filtering modes (
.nearestfor pixel art,.linearfor smooth scaling) - Texture and atlas preloading, animation from atlas frames
Constraints
SKConstrainttypes: orient, position, distance, rotationSKRangecreation patterns- Constraint ordering and toggling
Scene Setup
SKViewdebug overlays and performance settings- Scale mode matrix
SKTransitiontypes, including customCIFiltertransitions
Particles
SKEmitterNodeproperties by category (emission, position, movement, appearance, scale, rotation)- Presets for fire, smoke, sparks, rain, snow, trails, and explosions
SKRenderer and Shaders
SKRendererin a Metal render loopSKShaderGLSL ES source with uniforms, attributes, and built-in variables
SwiftUI Integration
SpriteViewwith transition, pause, frame rate, options, and debug options- An
@Observablemodel as the bridge between SwiftUI and a scene
Documentation Scope
This page documents the spritekit-ref skill (in the axiom-games suite), the API lookup surface for SpriteKit. Architecture patterns and best practices live in the spritekit skill, and troubleshooting lives in spritekit-diag; both are listed under Related.
Related
- SpriteKit – game architecture, physics setup, and the patterns that use these APIs
- SpriteKit Diagnostics – troubleshooting physics contacts that never fire, objects tunneling through walls, frame-rate drops, and other SpriteKit symptoms
- spritekit-auditor – scans your game code for bitmask mistakes, draw-call waste, node accumulation, and action leaks
Resources
WWDC: 2014-608, 2016-610, 2017-609
Docs: /spritekit/skspritenode, /spritekit/skphysicsbody, /spritekit/skaction, /spritekit/skemitternode, /spritekit/skrenderer