How can I make my GameScene fit the full screen?

I am using what I learned in the video tutorials to fill the screen (code below). aspectFit leaves me lots of blank space so I can't use that. However, after applying aspectFill the scene width & height values remain unchanged.

Is there a way I can either read size of the actual screen, or detect where the scene boundaries are off the screen?

Code Block
if let view = self.view as! SKView?
{
let scene = GameScene(size: CGSize(width: 1536 ,
height: 2048))
scene.scaleMode = .aspectFill
view.presentScene(scene)
}


Answered by OOPer in 623512022

Is there a way I can either read size of the actual screen

How is this?
Code Block
            let size = UIScreen.main.bounds.size


Accepted Answer

Is there a way I can either read size of the actual screen

How is this?
Code Block
            let size = UIScreen.main.bounds.size


Thanks, and using your answer I found the way to get the pixels.

Code Block
UIScreen.main.nativeBounds.width



How can I make my GameScene fit the full screen?
 
 
Q