Create Your First Sprite Node

A scene without content is like a game without a player. But before you can add content to your SpriteKit scene, you first need to learn about the SKNode class.

The SKNode class, although it doesn’t render (draw) any visual content, is considered the building block of SpriteKit because every node in a SpriteKit scene is a subclass of SKNode. Each subclass has a specific function or purpose.

To draw content, you need to use a visual node, such as:

  • SKSpriteNode: Perhaps the most widely used type, this node draws a rectangle texture, image, or color.

  • SKShapeNode: This type of node is used along with a Core Graphics path to draw custom shapes.

  • SKLabelNode: When you need text, this type of node is used to draw a text ...

Get Apple Game Frameworks and Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.