Post

Replies

Boosts

Views

Activity

Reply to How can you pause a SpriteKit scene from SwiftUI, without reinitializing it every time?
Thanks a lot @OOPer. It works as intended. One more related question. To track the paused state inside of the SpriteKit scene, I guess the best option would be to call a method on the scene, maybe in the onChange(of:perform:) modifier? var body: some View {     ZStack {       SpriteView(scene: scene, isPaused: showingLevelChooser)         .ignoresSafeArea()       VStack {         Button("Level Chooser") {           showingLevelChooser.toggle()         }         Spacer()       }     }     .sheet(isPresented: $showingLevelChooser) {       VStack {         Button("Cancel") {           showingLevelChooser.toggle()         }         Text("Level Chooser")       }       .background(BackgroundClearView())     } //↓     .onChange(of: showingLevelChooser) { value in       scene.isPaused(value)     }   }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to SpriteView doesn't pause scene on state change
The solution is to use an id on the GameScene and send it to the SpriteView with the .id() modifier, to force SwiftUI to create a new SpriteView. class GameScene: SKScene, ObservableObject { var id = UUID() } SpriteView(scene: scene, isPaused: paused).id(scene.id) This question was answered on SO: https://stackoverflow.com/questions/69610165/spriteview-doesnt-pause-scene-on-state-change/69610906#69610906 by @jnpdx.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Older macs on BigSur won't be able to develop iOS 15.4+ apps anymore?
Yes, what I meant is being able to run/test apps on devices running iOS 15.4+, or on the simulator running those versions. Basically you won't be able to use iOS 15.4+ SDKs at all while developing. This is definitely not good. A 2014 Macbook Pro is totally capable of running Monterey. Even more so that the 2014 Mac Mini is still supported by Apple to update to Monterey. A decision that is really hard to understand... Thanks for your reply.
Feb ’22
Reply to SKView showsFields draws only on a portion of the screen
Looks like there is more to SKView.showsFields. When showsFields is true, if you have an SKFieldNode.customField({}) in the scene, the custom block is called for what appears to be physics bodies to the far top right, with different positions, zero velocity, 1.0 mass, 0.0 charge. Same, this can be easily replicated using the Game Playground, by adding an SKFieldNode.customField({}) with a block that prints out the arguments. If SKView.showsFields is false, the block is not called, as it should be. Feedback report has been updated but there's no update on it.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Apr ’22
Reply to Precompile SKShader
This has been tested in Xcode 15.5.1 on a Macbook Pro Mid 2014 running macOS Big Sur 11.5.2 (20G95), on simulators running iOS 12.1, 14.5, and iPhone Xs running iOS 14.8.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Sep ’21
Reply to Crash on iOS 14.x because iOS 15 symbols not found
I have the same problem when trying to use something from iOS 15 only, using if #available(iOS 15.0, *) {. Crashes on iOS 14 with "dyld: Symbol not found". Have you found a solution to this problem?
Replies
Boosts
Views
Activity
Oct ’21
Reply to Dyld Symbol not found on Local Swift Package
Have you found any solution to this problem? I get the same crash with Xcode 13, trying to use something from iOS 15 and it crashes on iOS 14.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to @available(iOS 15.0, *) causes runtime crash on iOS 14.7 device
Where you able to find a solution? I get the same crash using if #available(iOS 15.0, *) { on Xcode 13.
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How can you pause a SpriteKit scene from SwiftUI, without reinitializing it every time?
Thanks a lot @OOPer. It works as intended. One more related question. To track the paused state inside of the SpriteKit scene, I guess the best option would be to call a method on the scene, maybe in the onChange(of:perform:) modifier? var body: some View {     ZStack {       SpriteView(scene: scene, isPaused: showingLevelChooser)         .ignoresSafeArea()       VStack {         Button("Level Chooser") {           showingLevelChooser.toggle()         }         Spacer()       }     }     .sheet(isPresented: $showingLevelChooser) {       VStack {         Button("Cancel") {           showingLevelChooser.toggle()         }         Text("Level Chooser")       }       .background(BackgroundClearView())     } //↓     .onChange(of: showingLevelChooser) { value in       scene.isPaused(value)     }   }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Contents of .sheet() are being redrawn after dismiss and not presenting
Posted on StackOverflow too: https://stackoverflow.com/questions/69485762/contents-of-a-swiftui-sheet-are-being-redrawn-after-dismiss-and-not-presentin
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Precompile SKShader
Similar question without an answer on Stack Overflow: https://stackoverflow.com/questions/65170998/how-to-compile-fragment-shader-ahead-of-time
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to [Metal Compiler Warning] unknown variable
Any update on this warning?
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to SpriteView doesn't pause scene on state change
The solution is to use an id on the GameScene and send it to the SpriteView with the .id() modifier, to force SwiftUI to create a new SpriteView. class GameScene: SKScene, ObservableObject { var id = UUID() } SpriteView(scene: scene, isPaused: paused).id(scene.id) This question was answered on SO: https://stackoverflow.com/questions/69610165/spriteview-doesnt-pause-scene-on-state-change/69610906#69610906 by @jnpdx.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to SpriteKit draw calls not batched when using a texture atlas from data stored in the app bundle
I also submitted a feedback report with Apple: https://feedbackassistant.apple.com/feedback/9763803
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Xcode scene editor not displaying svg textures from reference nodes
I submitted a feedback with Apple too: https://feedbackassistant.apple.com/feedback/9763834
Replies
Boosts
Views
Activity
Nov ’21
Reply to Older macs on BigSur won't be able to develop iOS 15.4+ apps anymore?
Yes, what I meant is being able to run/test apps on devices running iOS 15.4+, or on the simulator running those versions. Basically you won't be able to use iOS 15.4+ SDKs at all while developing. This is definitely not good. A 2014 Macbook Pro is totally capable of running Monterey. Even more so that the 2014 Mac Mini is still supported by Apple to update to Monterey. A decision that is really hard to understand... Thanks for your reply.
Replies
Boosts
Views
Activity
Feb ’22
Reply to Game Center authentication workflow
Same problem here. Has anyone found any workarounds to this issue?
Topic: Graphics & Games SubTopic: GameKit Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to autenticateHandler not being called
It looks like a bug or a change that was introduced in the framework, that is contrary to what the docs say. Consider filling a bug report with Apple https://feedbackassistant.apple.com/
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Feb ’22
Reply to SKView showsFields draws only on a portion of the screen
Looks like there is more to SKView.showsFields. When showsFields is true, if you have an SKFieldNode.customField({}) in the scene, the custom block is called for what appears to be physics bodies to the far top right, with different positions, zero velocity, 1.0 mass, 0.0 charge. Same, this can be easily replicated using the Game Playground, by adding an SKFieldNode.customField({}) with a block that prints out the arguments. If SKView.showsFields is false, the block is not called, as it should be. Feedback report has been updated but there's no update on it.
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Apr ’22