Skip to content

SceneOpenContext beta ​

Interface of @v12-engine/client/app

ts
export interface SceneOpenContext<A extends object = {}>

What a scene is opened with (Scene.open): what it was opened with (args), the way to the others (goTo), the app's scenes, what the app runs with, who builds the navigations of the worlds it makes, and a way to draw a Solid component in an element under the app's own (its overlays: tooltips, menus, dialogs)

Members ​

args ​

ts
args: SceneArgs<A>;

What the scene was opened with (goTo, the page's address): the shared arguments and its own

goTo ​

ts
goTo: GoTo;

For a scene that sends the player elsewhere: to the editor, to another map

hold ​

ts
hold(): () => void;

Holds the scene before on the page until what this gives back is called, for a scene not ready as it has opened: its files to come, a fetch. Called while it opens; a scene that never calls it is ready as open returns. One not ready in time comes in as it is (StartAppOptions.patience). The client's own scenes do this by themselves

ts
navigation?: NavigationBuilds;

Who builds the navigation of the worlds the scene makes, and where what was built is kept: the app's worker (StartAppOptions.navigationWorker), for prepareGame (GameSource.navigation). This thread when left out

render ​

ts
render(element: HTMLElement, component: () => JSX.Element): () => void;

Draws a Solid component into an element under the app's own tree, so that what it draws has the app's overlays and the rest of what the app gives its pieces. Gives back what takes it away. A scene of plain DOM needs none of it

runtime ​

ts
runtime: ClientRuntime;

What the app runs with (ClientRuntime): where it keeps things in the browser. The page's outside an app

scenes ​

ts
scenes: Scenes;

The scenes of the app, to find another by its id (find)

warm ​

ts
warm?(scene: string | SceneRef<any>, args?: SceneArgs<any>): Promise<void>;

Fetches a scene ahead of its opening (app.warm): what a screen of the game's own says as the pointer comes over its button. In an app's scenes