GameClientOptions beta
Interface of @v12-engine/client
export interface GameClientOptionsWhat a game's client is made with: the canvas, the player's session and the rest of what it draws and plays through. The renderer is made on the canvas as the client is (createLiteClient)
Members
antialias
antialias?: boolean;Whether the picture is drawn with anti-aliasing: as the settings say when left out
assets
assets?: {
base?: string;
} | Assets;Where the game's files are: the address the shared folders and the game's own (GameView.files.assets) are under, the app's base when left out (/, or what it is deployed under); or the Assets to find them with, made by the game
canvas
canvas: HTMLCanvasElement;The canvas the client draws the game on
debug
debug?: LocalSession | boolean;Direct access to the simulation, for the debug tools. Only there when the game runs in the page itself: nothing the player needs may depend on it. true for the session itself, when it is one played in the page: no need to hand the same session over twice
errorPolicy
errorPolicy?: ErrorPolicy;What a game played in the page comes to when its rules throw, where its rules say nothing (Rules.onError): 'end' ends it there, and the player is told (Failure). The world's own (it throws) when left out
keepsMusic
keepsMusic?: boolean;The music playing goes on, and this game starts none: a game behind a menu that has music of its own (MenuDef.music)
log
log?: Logger;The logger the client's own is made under (client.log): the page's, a tool's. The client's shared one when left out
lookAt
lookAt?: Vec2;Where the camera starts
mixer
mixer?: AppMixer;The app's sound, which this game's attaches to: the runtime's (ClientRuntime.mixer) in an app, one of its own elsewhere
overlay
overlay: HTMLCanvasElement;2D canvas stacked on top of the main one
pack
pack?: MapPack;The files the map brings with it, looked up before the game's (see MapPack)
qualityKept
qualityKept?: boolean;Whether the player kept a quality before (QualityParts.kept)
qualityStart
qualityStart?: QualityPreset;The quality preset to start at where nothing was set (see QualityParts.start)
reconnect
reconnect?: Reconnect;How a dropped connection to a server is got back (client.connection): what made the session says, the lobby (LobbyController.reconnect). A drop is lost at once without
root
root?: HTMLElement;The game's element on the page, with the canvas and the HUD in it: its theme is put on it, and keys pressed with the focus elsewhere of the page are not the game's. The canvas's parent when left out
runtime
runtime?: ClientRuntime;What the app runs with (ClientRuntime): where it keeps things in the browser. The page's when left out
saves
saves?: SaveControls;Saving and loading where the game is played (SaveControls): the client's saves are made of it (client.saves). None without
session
session: GameSession;The player's seat in the game. Everything the client knows and does goes through it
settingsStore
settingsStore?: SettingsStore;Where what the player sets is kept: the browser's when left out (SettingsStore)
startView
startView?: string;Where the camera starts, by the name of a view of the map (MapCamera): over lookAt when the map has it
view
view: GameView;How the game looks and sounds: the client side of the game module