I have a pretty standard Spritekit Scene that loads from a SwiftUI view. All settings are set to landscape only. Scene dimensions are correct. How can I stop the GameScene from rotating when I go into portrait mode? I didn't have this issue when using regular Swift before. Is this a SwiftUI issue?
Also I have managed to get my Preview window to be in Landscape but when I run Live Preview it returns to portrait.
This is my ContentView code with the SKScene.
struct ContentView: View {
var scene: SKScene {
let scene = GameScene()
scene.size = CGSize(width: 1080, height: 800)
scene.scaleMode = .fill
scene.backgroundColor = .black
return scene
}
var body: some View {
SpriteView(scene: scene)
.frame(width: 1080, height: 800, alignment: .center)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
.previewDevice("iPad (8th generation)")
.previewLayout(.fixed(width: 1080, height: 800))
}
}