Show the code you use to declare the property for the scene in the SwiftUI view
Here it is:
private var mainCamera: SKCameraNode?
class func newGameScene() -> SKScene {
if let scene = SKScene(fileNamed: "MapScene") {
// Set the scale mode to scale to fit the window
scene.scaleMode = .aspectFill
// Present the scene
return scene
} else {
abort()
}
}
}
What are you trying to do?
I'm trying to access to interact with my scene from a .sks file. By interact, I mean writing code to interact with the scene, like we do when we have a SpriteKit project.
What do you expect to happen?
I can program my scene.
What happens?
I can see my scene in the built project, but I can't program it.
But even if you couldn't help me, at least you tried. So thank you ❤️
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: