Skip to content

playScene beta ​

Function of @v12-engine/client/app

ts
export declare function playScene(scene: GameScene<any>, element: HTMLElement, context: SceneOpenContext<any>, options?: {
    onLoaded?: (client: GameClient) => void;
    onFailed?: () => void;
    loading?: LoadingLook;
    keepsMusic?: boolean;
    behind?: boolean;
}): () => void;

Plays a game scene in an element, as the app shows one: run (runGame) and drawn with its HUD, its client made by the scene's load. What a game scene's open is (asGameScene); the code that plays it is fetched with the first game opened. The scene before is held until the game is on, or could not be; a scene with a loading screen of its own (GameScene.loading) comes in at once and shows it. options: told once the game is on (onLoaded) or that it could not be, or stopped (onFailed), the loading screen to show in place of the scene's (loading: a menu's behind shows none), whether the music playing goes on with the game starting none (keepsMusic: behind a menu with music of its own), and that it plays behind a menu (behind), so that the games kept behind menus are not taken away for it