Last active
June 17, 2019 08:54
-
-
Save lalabuy948/3648653284a0da91665d59a74f8fdd55 to your computer and use it in GitHub Desktop.
Background snippet for spritekit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import SpriteKit | |
class gameScene: SKScene { | |
var background = SKSpriteNode(imageNamed: "bgimage") | |
override func sceneDidLoad(view: SKView) { | |
background.position = CGPoint(x: frame.size.width / 2, y: frame.size.height / 2) | |
background.zPosition = -1; | |
addChild(background) | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment