Making a SKScene's background transparent not working… is this a bug?

前端 未结 5 722
挽巷
挽巷 2020-12-03 06:52

Is there a way to make a SKScene\'s background transparent and present that scene over another one seeing thru the transparency.

The idea is to have the background o

5条回答
  •  一向
    一向 (楼主)
    2020-12-03 07:03

    swift 3

    @IBOutlet var gameScene: SKView!
    
    func setupGameScene(){
    
        if let scene = SKScene(fileNamed: "GameScene") {
            scene.scaleMode = .aspectFill
            scene.backgroundColor = .clear
            gameScene.presentScene(scene)
            gameScene.allowsTransparency = true
            gameScene.ignoresSiblingOrder = true
            gameScene.showsFPS = true
            gameScene.showsNodeCount = true
        }
    }
    

提交回复
热议问题