TechnologiesGames & 3D

SpriteKit

iOSmacOStvOSwatchOSvisionOS

SpriteKit is a 2D sprite-based game engine with Metal-backed rendering for iOS, macOS, tvOS, watchOS, and visionOS. You compose a scene from nodes such as SKLabelNode, SKEmitterNode, SKLightNode, SKAudioNode, and SKCameraNode, then animate and drive them with SKAction sequences and timing modes. Movement and collisions are handled by the physics system through SKPhysicsBody, SKPhysicsWorld, joints like SKPhysicsJointPin and SKPhysicsJointSpring, and contact reporting via SKPhysicsContact and SKPhysicsContactDelegate. You can further shape behavior with SKConstraint, force fields from SKFieldNode, masking with SKCropNode and SKEffectNode, and particle effects configured by SKKeyframeSequence.

Scenes and Views 8

The scene that hosts your game content and the views and renderers that present it.

  • Cl
    SKScene
    A scene is the root node of your content. It is used to display SpriteKit content on an SKView.
  • Cl
    SKView
    A view that displays SpriteKit content and presents scenes.
  • Cl
    SKRendereriOS 11.0+
    A renderer for displaying a SpriteKit scene in an existing Metal workflow.
  • Cl
    SKTransition
    A transition style from one scene to another.
  • En
    SKSceneScaleModeiOS 7.0+
    Constants that specify how a scene is scaled to fit its presenting view.
  • En
    SKTransitionDirectioniOS 7.0+
    Constants that specify the direction of an animated scene transition.
  • Pr
    SKSceneDelegateiOS 8.0+
    A protocol you implement to perform per-frame logic on behalf of a scene.
  • Pr
    SKViewDelegateiOS 10.0+
    A protocol you implement to control whether a view renders each frame.

Nodes 15

The visual and structural building blocks you compose into a scene graph.

  • Cl
    SKSpriteNode
    A Sprite is a textured 2D node. It can be placed, rotated, scaled and animated like any other node except it draws a textured rectangle specified by the bounds and anchor point.
  • Cl
    SKLabelNode
    A node that displays a text label with a given font.
  • Cl
    SKShapeNode
    A SpriteKit Node used to stroke or fill a shape. CGPaths are used to supply the path.
  • Cl
    SKEmitterNode
    An emitter of particle sprites.
  • Cl
    SKLightNodeiOS 8.0+
    A node that adds light and shadow to sprites in the scene.
  • Cl
    SKAudioNodeiOS 9.0+
    A SpriteKit scene graph audio node that provides a way to link audio graphs to a SpriteKit scene.
  • Cl
    SKVideoNode
    A node that plays video content within the scene.
  • Cl
    SKCameraNodeiOS 9.0+
    A Camera node is a full fledged SKNode that can have actions and physics applied to it.
  • Cl
    SKFieldNodeiOS 8.0+
    A node that applies physics forces to bodies within a region of the scene.
  • Cl
    SK3DNodeiOS 8.0+
    A node that renders a 3D SceneKit scene inside a 2D SpriteKit scene.
  • Cl
    SKReferenceNodeiOS 9.0+
    A node that loads and instantiates its content from an external archive or file.
  • Cl
    SKCropNode
    A SpriteKit node that masks child nodes using another node's alpha component
  • Cl
    SKEffectNode
    A SpriteKit node that applies frame buffer effects to the rendered results of its child nodes. This is done continuously on live content and is not a simple snapshot of the rendered result at one inst
  • Cl
    SKTransformNodeiOS 11.0+
    An SKTransformNode can be applied a 3D rotation that will affect
  • En
    SKNodeFocusBehavioriOS 11.0+
    Constants that specify how a node participates in focus-based navigation.

Actions and Animation 5

Time-based actions and keyframe sequences that animate and drive node behavior.

  • Cl
    SKAction
    An SKAction object is an action that is executed by a node in the scene.
  • En
    SKActionTimingModeiOS 7.0+
    Adjust the timing of an action
  • Cl
    SKKeyframeSequence
    An object that interpolates values across a series of keyframes for particle effects.
  • En
    SKInterpolationMode
    Constants that specify how values are interpolated between keyframes.
  • En
    SKRepeatMode
    Constants that specify how a keyframe sequence repeats past its final keyframe.

Physics Simulation 4

The physics world, bodies, and contact reporting that handle movement and collisions.

  • Cl
    SKPhysicsWorld
    The object that simulates physics and manages forces, gravity, and contacts for a scene.
  • Cl
    SKPhysicsBody
    A SpriteKit physics body. These are the physical representations of your nodes. These specify the area and mass and any collision masking needed.
  • Cl
    SKPhysicsContact
    An object that describes a contact between two physics bodies.
  • Pr
    SKPhysicsContactDelegate
    A protocol you implement to respond to contacts between physics bodies.

Physics Joints 6

Joints that connect physics bodies and constrain how they move relative to each other.

  • Cl
    SKPhysicsJoint
    The base class for joints that connect two physics bodies.
  • Cl
    SKPhysicsJointPin
    A joint that pins two bodies together, allowing them to rotate about an anchor point.
  • Cl
    SKPhysicsJointSpring
    A joint that connects two bodies with spring-like elasticity.
  • Cl
    SKPhysicsJointFixed
    A joint that fuses two bodies together at a fixed reference point.
  • Cl
    SKPhysicsJointSliding
    A joint that allows two bodies to slide along a specified axis.
  • Cl
    SKPhysicsJointLimit
    A joint that imposes a maximum distance between two bodies.

Constraints and Regions 4

Constraints, value ranges, and regions that limit node positions and field effects.

  • Cl
    SKConstraintiOS 8.0+
    SKConstraints are evaluated each frame after actions and physics.
  • Cl
    SKReachConstraintsiOS 8.0+
    An object that defines rotation limits for inverse-kinematics reach actions.
  • Cl
    SKRangeiOS 8.0+
    SKRange object used to define a range of allowable values
  • Cl
    SKRegioniOS 8.0+
    An object that defines an area used to limit the effect of a field node.

Textures and Shaders 11

Textures, atlases, and shader programs that supply imagery and custom GPU effects.

  • Cl
    SKTexture
    A texture to be mapped onto SKSpriteNode instances.
  • Cl
    SKMutableTextureiOS 8.0+
    A texture whose contents you can update directly after creation.
  • Cl
    SKTextureAtlas
    A collection of related textures packed together for efficient rendering.
  • En
    SKTextureFilteringModeiOS 7.0+
    Constants that specify the filtering applied when a texture is scaled.
  • Cl
    SKShaderiOS 8.0+
    A custom fragment shader that modifies how a node's content is drawn.
  • Cl
    SKUniformiOS 8.0+
    A custom uniform value that you pass to a shader.
  • En
    SKUniformTypeiOS 8.0+
    Constants that specify the data type of a shader uniform.
  • Cl
    SKAttributeiOS 9.0+
    A per-node attribute that supplies custom data to a shader.
  • Cl
    SKAttributeValueiOS 9.0+
    A container that holds the value of a shader attribute for a specific node.
  • En
    SKAttributeTypeiOS 9.0+
    Constants that specify the data type of a shader attribute.
  • En
    SKBlendModeiOS 7.0+
    Blend modes that the SKNode uses to compose with the framebuffer to produce blended colors.

Tile Maps 8

Tile-based maps and the definitions, sets, and groups that describe their tiles.

  • Cl
    SKTileMapNodeiOS 10.0+
    A SpriteKit node used to render a 2D array of textured sprites. Uses SKTileSet to determine what textures it can use to render. Separate tile map nodes can be layered on top of one another to achieve
  • Cl
    SKTileDefinitioniOS 10.0+
    A tile definition contains the information needed to represent a single type of tile within a tile map.
  • Cl
    SKTileSetiOS 10.0+
    A tile set contains all of the tile definitions that are available for use in a tile map. In addition, it also contains tile groups, which define collections of related tile definitions and the rules
  • Cl
    SKTileGroupiOS 10.0+
    A tile group encapsulates a collection of related tile definitions that are designed to be pieced together within a tile map. How those tiles are pieced together is governed by the set of rules. When
  • Cl
    SKTileGroupRuleiOS 10.0+
    A tile group rule defines how a certain type of tile should be placed on the map. These tiles are like puzzle pieces, and the rules define how they should be pieced together. This is accomplished by d
  • En
    SKTileSetTypeiOS 10.0+
    The tile set type is used to describe how the tiles will be arranged in a tile map.
  • St
    SKTileAdjacencyMaskiOS 10.0+
    The adjacency mask is used to specify which neighboring tiles need to be filled in for a rule to go into effect.
  • En
    SKTileDefinitionRotationiOS 10.0+
    Adjust the rotation of the tile definition image, in 90 degree increments.

Warp Geometry 3

Geometry grids and protocols for distorting node content with warp effects.

  • Cl
    SKWarpGeometryiOS 10.0+
    An object that describes a geometric warp applied to a node's content.
  • Cl
    SKWarpGeometryGridiOS 10.0+
    A warp geometry defined by a grid of source and destination positions.
  • Pr
    SKWarpableiOS 10.0+
    A protocol adopted by nodes that support warp geometry distortion.

Particle Configuration 1

Options that control how particle emitters render and order their particles.

  • En
    SKParticleRenderOrderiOS 9.0+
    Constants that specify the order in which an emitter renders its particles.

Text Layout 2

Alignment options that position the text drawn by a label node.

  • En
    SKLabelVerticalAlignmentModeiOS 7.0+
    Constants that specify how a label aligns text vertically about its position.
  • En
    SKLabelHorizontalAlignmentModeiOS 7.0+
    Constants that specify how a label aligns text horizontally about its position.

Classes 1

  • Cl
    SKNode

Structures 1

  • St
    SpriteViewiOS 14.0+
    The view to present your SKScene nodes in.

Type Aliases 3

  • Ty
    SKActionTimingFunction
    A custom timing function for SKActions. Input time will be linear 0.0-1.0
  • Ty
    SKFieldForceEvaluator
    A field force with a custom force evaluator.
  • Ty
    SKColor

Extends 1

UITouch
← Games & 3D