spx
spx copied to clipboard
Reliable way to detect game failure
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