Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

ScenesState

Property Type Description
active string | null -
go (name) => void Makes that scene the one Game draws. Throws on a name nobody registered.
goOnceRegistered (name, options) => Disposer Makes that scene the one Game draws once a Scene has registered it: now, or at its registration, as a scene a module loads on its own registers after the start-up. onError takes the error when none has within the time. The return stops waiting.
registerScene (name, component) => Disposer Names a scene; the return forgets it.
reload () => void Starts the active scene again: its world and entities go, and spawn anew as they did when it opened.
reloads number The reloads so far: the active scene’s key, so each one remounts it.
scenes Record<SceneName, ComponentType> -