Skip to content

StartedApp ​

Interface of @v12-engine/client/app

ts
export interface StartedApp

An app started: its scenes, to add to in code, and what takes it off the page

Members ​

dispose ​

ts
dispose(): void;

Takes the app off the page and releases what it holds

fullscreen ​

ts
fullscreen(on?: boolean): Promise<boolean>;

Full screen for the whole app: its element, so that it stays through the scenes, menus and games alike (a game's own button asks for this one too). On, off, or the other when left out; true once it is on. A browser asks for a press or a key first

overlays ​

ts
readonly overlays: Overlays;

What floats over the app's own screens: a toast, a dialog, a menu opened from code outside of any component (app.overlays.toast('Saved')). A component reaches the ones of where it is with useOverlays(): a game's own, inside a game

runtime ​

ts
readonly runtime: ClientRuntime;

What the app runs with (ClientRuntime): where it keeps things in the browser, its own (storagePrefix)

scenes ​

ts
readonly scenes: Scenes;

The app's scenes, to add to in code after it has started

warm ​

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

Fetches a scene ahead of its opening, by its id or itself: its code and the code that plays a game, then the files it starts with (Scene.warmFiles; GameView.files.preload says which), with nothing drawn. Once for the same scene and args. Settles once they are there, or have failed and been said in the log. MenuDef.warm says it of a menu