I would like to use the Count variable to use a sprite note in the spritekit framework with the digital crown. At the moment I'm doing it via watchkit and I would be interested if it is even possible in swiftui.
class Gamescene: SKScene {
var player = SKSpriteNode(color: .red, size: CGSize(width: 20, height: 20))
override func sceneDidLoad() {
player.position = CGPoint(x: size.width / 2, y: size.height / 2)
addChild(player)
}
}
struct ContentView: View {
@State var counter = 0.0
var body: some View {
SpriteView(scene: Gamescene(size: CGSize(width: 100, height: 150)))
.ignoresSafeArea()
.focusable()
.digitalCrownRotation($counter)
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: