Make SpriteKit scene transparent in Swift

Swift
x
24
import SpriteKit
class GameScene: SKScene {
override func didMoveToView(view: SKView) {
// Make the scene transparent
self.backgroundColor = UIColor.clearColor()
// Add a background image to the scene
let backgroundImage = SKSpriteNode(imageNamed: "background")
backgroundImage.position = CGPointMake(self.size.width/2, self.size.height/2)
self.addChild(backgroundImage)
}
override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
}
override func update(currentTime: CFTimeInterval) {
🤖 Code Explanation

More problems solved in Swift



















