SpriteKit Namespace

The SpriteKit namespace provides a library for 2D graphics, animation, and physics.

Classes

SK3DNode

Renders a Scene Kit image as a textured 2D image. Used to incorporate Scene Kit content into a Sprite Kit app.

SKAction

Modifies properties on a SKNode, often animating the changes. Sometimes reversible.

SKAttribute

Holds per-node data to be used with a custom shader.

SKAttributeValue

Holds the value, of the appropriate SKAttributeType, for an SKAttribute.

SKAudioNode

A SKNode that holds audio information.

SKCameraNode

A node that specifies the position inside a SKScene from which it can be rendered.

SKConstraint

Mathematical constraint on a node's position or orientation.

SKCropNode

A node that masks its children's pixels.

SKEffectNode

An SKNode that applies a Core Graphics CIFilter to its output.

SKEmitterNode

A SKNode that produces colored and textured particles.

SKFieldNode

Applies physics effects within a portion of a scene.

SKKeyframeSequence

An object that can control the properties of particles emitted by a SKEmitterNode.

SKLabelNode

A SKNode that displays a string.

SKLightNode

A node that creates a lighting effect within a scene.

SKMutableTexture

A texture that can be modified after assignment.

SKNode

The building block out of which scene-graphs are made. The root of the tree is an SKScene.

SKNodeEvent_NSEvent
SKNodeTouches_UITouch

Extension methods for UITouch that aide with conversion to Sprite Kit coordinates.

SKPhysicsBody

An object that reacts to the physics simulation of the SKScene's PhysicsWorld.

SKPhysicsContact

Encapsulates the data of a collision between two SKPhysicsBodys.

SKPhysicsContactDelegate

A delegate object for SKPhysicsWorld that provides events when SKPhysicsBodys begin and end contact with each other.

SKPhysicsContactDelegate_Extensions

Extension methods to the ISKPhysicsContactDelegate interface to support all the methods from the SKPhysicsContactDelegate protocol.

SKPhysicsJoint

Base class for subtypes that join bodies in the physics engine.

SKPhysicsJointFixed

A SKPhysicsJoint that rigidly connects two bodies.

SKPhysicsJointLimit

A SKPhysicsJoint that connects two bodies as if by a rope.

SKPhysicsJointPin

A SKPhysicsJoint that pins two bodies to a common point.

SKPhysicsJointSliding

A SKPhysicsJoint that connects two bodies as if by a sliding rod.

SKPhysicsJointSpring

A SKPhysicsJoint that connects two bodies as if by a spring.

SKPhysicsWorld

Manages the physics for a SKScene.

SKRange

Defines a range for acceptable float values.

SKReachConstraints

A range of motion used with inverse kinematics.

SKReferenceNode

A SKNode that holds an archived collection of child nodes that can be used in multiple places throughout the game.

SKRegion

A path-defined area. Typically used for hit-testing and physics-field extents.

SKRenderer

The class used to render SpriteKit.

SKScene

A scene of content in Sprite Kit. The root of a tree of Sprite Kit nodes.

SKSceneDelegate

Delegate object for SKScene objects. Provides methods relating to animation events.

SKSceneDelegate_Extensions

Extension methods to the ISKSceneDelegate interface to support all the methods from the SKSceneDelegate protocol.

SKShader

An OpenGL ES fragment shader.

SKShapeNode

A SKShapeNode defined by a Core Graphics CGPath.

SKSpriteNode

A SKShapeNode that displays a textured, colored sprite.

SKTexture

An image that can be used with one or more SKSpriteNodes and particles.

SKTextureAtlas

A collection of SKTextures that are loaded from a single source.

SKTextureAtlasLoadResult
SKTileDefinition

A single kind of tile in a tile map.

SKTileGroup

A collection of related SKTileDefinition objects.

SKTileGroupRule

Defines adjacency rules for tiles in an SKTileGroup.

SKTileMapNode

A SKNode that encapsulates a tiled map and a SKTileSet.

SKTileSet

Represents the possible elements of a SKTileMapNode in the form of SKTileGroup objects.

SKTransformNode

A SKNode that holds a geometric transform.

SKTransition

Transitions that can be used between SKScenes. Used with the PresentScene(SKScene, SKTransition) method.

SKUniform

Holds shareable uniform data for SKShader objects.

SKVideoNode

A SKNode that displays video.

SKView

A UIView that displays a SKScene.

SKView.SKViewAppearance

Appearance class for objects of type SKView.

SKViewDelegate

Delegate object for SKView objects, allowing the developer to control the frame rate.

SKViewDelegate_Extensions

Extension methods to the ISKViewDelegate interface to support all the methods from the SKViewDelegate protocol.

SKWarpGeometry

Defines geometry deformation on SKNode objects.

SKWarpGeometryGrid

A SKWarpGeometry subclass that defines a warpable grid.

Interfaces

ISKPhysicsContactDelegate

Interface representing the required methods (if any) of the protocol SKPhysicsContactDelegate.

ISKSceneDelegate

Interface representing the required methods (if any) of the protocol SKSceneDelegate.

ISKViewDelegate

Interface representing the required methods (if any) of the protocol SKViewDelegate.

ISKWarpable

Associates a SKWarpGeometry and subdivision levels with an implementation.

Enums

SKActionTimingMode

An enumeration whose values specify the time-varying behavior of a SKAction. Used with TimingMode.

SKAttributeType

Enumeration of valid types for SKAttribute values.

SKBlendMode

An enumeration whose values specify options for blending of visual SKNodes or particles.

SKInterpolationMode

An enumeration whose values specify the interpolation mode of a SKKeyframeSequence.

SKLabelHorizontalAlignmentMode

An enumeration whose values specify horizontal alignment of a SKLabelNode. Used with HorizontalAlignmentMode

SKLabelVerticalAlignmentMode

An enumeration whose values specify vertical alignment of a SKLabelNode. Used with VerticalAlignmentMode

SKNodeFocusBehavior

Enumerates the various ways a SKNode may be focusable.

SKParticleRenderOrder

Enumerates values used with ParticleRenderOrder.

SKRepeatMode

An enumeration whose values specify whether the time value of a SKKeyframeSequence should cycle.

SKSceneScaleMode

An enumeration whose values specify the way in which a SKScene scales to the view in which it is being displayed.

SKTextureFilteringMode

An enumeration whose values specify how a SKTexture is rendered on a SKSpriteNode of a different size.

SKTileAdjacencyMask

Enumerates how neighboring tiles may be automatically placed.

SKTileDefinitionRotation

Enumerates how a SKTileDefinition kind may be rotated.

SKTileSetType

Enumerates supported tiling schemes.

SKTransitionDirection

An enumeration of directions for use with SKTransitions.

SKUniformType

Contains values that describe the data with which an SKUniform was initialized.

Delegates

SKActionDurationHandler

The delegate for a custom action, used with CustomActionWithDuration(Double, SKActionDurationHandler).

SKActionTimingFunction

A method that maps time, a value between 0 and 1, to a return value between 0 snd 1.

SKActionTimingFunction2
SKFieldForceEvaluator

A method that derives a force by applying the physics of a field to a body that is within the field.

SKNodeChildEnumeratorHandler

The delegate that acts as the enumeration handler for EnumerateChildNodes(String, SKNodeChildEnumeratorHandler).

SKPhysicsWorldBodiesAlongRayStartEnumeratorHandler

The delegate used for enumerating bodies that fall along a ray when used with M:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.PointF,System.Drawing.PointF,SpriteKit.SKPhysicsWorldBodiesAlongRayStartEnumeratorHandler*.

SKPhysicsWorldBodiesEnumeratorHandler

The delegate used to enumerate SKPhysicsBodys with M:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.PointF,SpriteKit.SKPhysicsWorldBodiesEnumeratorHandler* and M:SpriteKit.SKPhysicsWorld.EnumerateBodies(System.Drawing.RectangleFF,SpriteKit.SKPhysicsWorldBodiesEnumeratorHandler*

SKTextureAtlasLoadCallback
SKTextureModify

A method that modifies a texture in place.

Remarks

Sprite Kit is a library that provides a high-performance animation and physics loop. It is well-suited for 2D game programming and is available on both iOS and OS X.

The animation loop:

The system restricts the animation loop to a maximum rate of 60Hz.

The visual aspect of the animation loop is determined by a scene-graph consisting of a hierarchy of SKNodes. The root of the scene-graph is a SKScene which itself is a T:SpiteKit.SKNode (see illustration below). SKNodes can be rectangular, based on a CGPath, or display text. SKNodes can be textured, colored, or display video. They can have T:CoreImage.CoreFilters applied to them and can be composited.

SKNodes can have an associated SKPhysicsBody. All of the SKPhysicsBodys in the PhysicsWorld of the SKScene are part of the physics loop. T:SpriteKitSKPhysicsBodys are joined to each other with SKPhysicsJoints, of which there are several sub-classes as shown in the following illustration.

Tile Sets

The SKTileMapNode subclass of SKNode allows developers to easily create and manipulate tile-based maps with a variety of geometries and perspectives. An SKTileMapNode contains a SKTileSet that defines the overall map. In addition, the SKTileSet contains one or more SKTileGroup objects, each of which represents one style of tile, which may have several representations.