1

I want to modify the size of SKScene but I have figure out how to do it. I have figure out how change the size but it square taking the smallest size of the screen:

func makeScene() -> SKScene {
        let minimumDimension = min(view.frame.width, view.frame.height)
        let size = CGSize(width: minimumDimension, height: minimumDimension)
        let scene = SKScene(size: size)
        scene.backgroundColor = .white
        return scene
}

Any of you knows how can I modify SKScene size (frame) programmatically ?

I'll really appreciate your help.

user2924482
  • 8,380
  • 23
  • 89
  • 173

1 Answers1

2

To modify the GameScene screen size, you can set go to GameScene.swift, and set the values.

self.size = CGSize(width: 100, height: 100)

Over here I have set the GameScene size to be 100 X 100. You can also change these values in the GameScene.sks, but the value stated in the code would over write it.

Animator Joe
  • 69
  • 1
  • 6