I know my question is similar to SKScene view not filling screen but the answer there does not answer the issue I am having.
I want the screen to fill the entire screen and not just a sub-section of it. I am using the Game template from Xcode 12.4 and the image below is how the game runs on the iPhone 12 simulator. Additionally, the scene size is 750x1334.
When I change the size of the scene with scene.size = view.bounds.size
I get the following:
The scene size changes as evidenced by the label being bigger but the viewable size is still the same. Is there a different size setting I should be changing? Im new to SpriteKit so any information would be helpful. Thanks!
Full GameViewController Code
class GameViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let view = self.view as! SKView? {
// Load the SKScene from 'GameScene.sks'
if let scene = SKScene(fileNamed: "GameScene") {
scene.scaleMode = .aspectFill
//Added below code in hopes to create larger viewable area
//scene.size = view.bounds.size
view.presentScene(scene)
}
view.ignoresSiblingOrder = true
view.showsFPS = true
view.showsNodeCount = true
}
}
override var shouldAutorotate: Bool {
return true
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if UIDevice.current.userInterfaceIdiom == .phone {
return .allButUpsideDown
} else {
return .all
}
}
override var prefersStatusBarHidden: Bool {
return true
}
}