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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access