Tutorial by Examples

SpriteKit functionality can be implemented in a subclass of SKScene. For example, a game may implement the main game functionality within an SKScene subclass called GameScene. In Swift: import SpriteKit class GameScene: SKScene { override func didMoveToView(view: SKView) { /* Co...
A simple use case it to create an SKScene that exactly fills the SKView. This avoids the need to consider scaling the view to fit or setting a camera to show a part of the scene. The following code assumes an SKView called skView already exists (e.g. as defined in Create a Full Screen SKView using ...
An SKScene has a scaleMode parameter that defines how it will change its size to fit within the SKView it is presented into the SKView if it is not the same size and/or shape. There are four options for scaleMode: AspectFit: the scene is scaled (but not stretched) until it fits within the view. ...
You can place an SKCameraNode into an SKScene to define which part of the scene is shown in the SKView. Think of the SKScene as a 2D world with a camera floating above it: the SKView will show what the camera 'sees'. E.g. the camera could be attached to the main character's sprite to follow the act...

Page 1 of 1