LaunchOptions beta
Interface of @v12-engine/client
export interface LaunchOptions extends GamePlayOptions, RuntimeOptionsWhat a game is launched with: what it is played with (GamePlayOptions), where on the page, and what the page does around it
Members
hud
hud?: boolean;Whether the HUD is shown. Yes when left out
leave
leave?: {
label: string;
run: () => void;
};The HUD's button out of the game: what it says, and what it does. No button without
navigationWorker
navigationWorker?: NavigationWorkerLike | (() => NavigationWorkerLike);A worker that builds the navigations of its worlds (S37), so that the page does not stand still while a large map is made: a worker of the page's own, whose file calls serveNavigationBuilds() (see navigationWorker). On the page's thread without. What was built is kept either way, and a world made again on the same ground reads it. Given as what makes it (() => new Worker(…)), it is made at the first build: the menu fetches none of it
onError
onError?: (error: unknown) => void;Told when the game could not be loaded, and when it stopped after (a frame that threw, a lost device, its rules that threw). Its error screen says so too
onLoaded
onLoaded?: (client: GameClient) => void;Told the client once the game is on: also after each restart
replays
replays?: ReplayChoice;Whether what is played is kept as a replay (ReplayChoice). Not when left out
saves
saves?: boolean | {
slot?: string;
name?: () => string;
store?: Store<SavedGame>;
};Whether the game is saved and loaded from its HUD. In this browser by default; store keeps them where the game says instead (a file of a desktop app, a cloud). slot is the place its saves are kept under, the game's id when left out: two pages that launch the same game apart give each its own
settings
settings?: {
store?: SettingsStore;
};Where what the player sets is kept, in place of this browser (Store, the record of SettingsRecord): a desktop app's file, an account's cloud. The browser's when left out
target
target: HTMLElement | string;Where on the page the game goes: an element, or a selector of one. The game fills it, so it has a size of its own: a height, most of all