spx icon indicating copy to clipboard operation
spx copied to clipboard

Reliable way to detect game failure

Open nighca opened this issue 7 months ago • 1 comments

Errors can occur during game execution. XBuilder aims to display a dedicated error UI when these occur.

Ideally, SPX would provide a reliable error detection API, such as an onError callback:

interface RunnerWindow {
  startGame(buffer: ArrayBuffer, assetURLs: Record<string, string>): Promise<void>
  stopGame(): Promise<void>
  onGameError(err => void)
}

// XBuilder may use the callback to display the error UI.
runner.onGameError(err => {
  showErrorUI()
})

Related: https://github.com/goplus/builder/pull/1681#discussion_r2097003788

nighca avatar May 20 '25 06:05 nighca