1

Right now I load my GameScene like this

if let scene = SKScene(fileNamed: "GameScene") {

 if bool {
    // Change size to CGSize(a, b)
 } else {
    // Change size to CGSize(x, y)
 }
 view.allowsTransparency = true
 scene.backgroundColor = .clear
 view.presentScene(scene)
}

However, depending on a certain bool I want to be able to change the initial size of the GameScene. I know this can be done using let scene = GameScene(size: size) but that means I can't use the .sks file for the GameScene which I have most stuff on.

How can I variably change the initial size of the GameScene while still using the .sks file?

P.S. scene.size = CGSize(a, b) does not seem to change anything

Pratik Sodha
  • 3,679
  • 2
  • 19
  • 38
J.Treutlein
  • 963
  • 8
  • 23
  • why do you want to do this? Scene.size = CGSize does change the size, but because of how scalemode works, you may not notice any differences. If I had an understanding of your purpse, I can better help explain a solution for you. – Knight0fDragon Sep 06 '18 at 13:09
  • right, essentially OP just has to use `.scalemode` – Fattie Sep 06 '18 at 14:42
  • OP, are u using an `SKView` to hold the `SKScene` ? – Fattie Sep 06 '18 at 15:24

0 Answers0