April 2021
Beginner to intermediate
506 pages
11h 57m
English
When you add nodes to a scene and set their position, knowing how the coordinate system works in SpriteKit is key to avoiding frustration.
In SpriteKit, the bottom-left corner of the unit coordinate system is located at (x: 0, y: 0) and the top-right corner is located at (x: 1, y: 1), as shown in the following illustration:
When you position a sprite node, you need to consider its anchorPoint property, which defaults to (x: 0.5, y: 0.5).
Look at the sprite node in the following image; its position property is set to (x: 0, y: 0). Notice how changing the anchorPoint can affect the node’s position. ...
Read now
Unlock full access