Contents

SKNode

The base class of all SpriteKit nodes.

Declaration

@MainActor class SKNode
class SKNode

Mentioned in

Overview

SKNode provides base properties for its subclasses and it can be used as a container or layout tool for other nodes. For example, you might add a collection of nodes as children to an SKNode that all move together within the scene; because nodes inherit the properties of their parent, changing the parent node’s position propagates the change to its children as well.

SKNode does not draw any content itself. Its visual counterparts are listed in Nodes that Draw in Nodes for Scene Building.

Topics

First Steps

Positioning Content in a Scene

Querying the Content Size

Configuring Draw Order

Scaling and Rotating

Accessing Related Nodes

Modifying the Node Tree

Customizing Nodes

Propagating Properties to Children

Accessing Nodes by Name

Altering Node Visibility

Running Actions

Adding Physics Behaviors

Constraining Node Position or Rotation

Detecting Collisions Manually

Adding GameplayKit Behaviors

Handling User Input

Hit Testing

Converting Between Coordinate Systems of Different Nodes

Adding Custom Data Without Subclassing

Providing Accessibility

Setting a Node’s Unique Attributes for a Shader

See Also

Base Nodes