HudClient
Interface of @v12-engine/client
export interface HudClientThe client, as a HUD has it (client of each of the HUD's parts, and of what a game draws in them): the HUD's state (ui), the player's hands (controller), the keys, settings, menus, saves and the rest of what is documented. Made by GameClient.forHud(); a test makes one of its own (testHudClient of @v12-engine/client/testing)
Members
abilityTip
abilityTip: GameClient['abilityTip'];What a button of an ability says of it
attachMinimap
attachMinimap(canvas: HTMLCanvasElement): () => void;Draws the minimap into a canvas of the HUD's; gives back what stops it
camera
readonly camera: {
lookAt(point: Vec2): void;
readonly focus: Vec2;
};Where the view looks: a HUD's button that shows something moves it there
connection
readonly connection: ConnectionController;The connection to a server, where the game is played on one
controller
readonly controller: PlayerActions;The player's hands, as far as a HUD goes
debugTools
readonly debugTools: DebugTools;The debug tools: their switches, numbers, buttons and measures, where the player may use them
dialog
readonly dialog: DialogQueue;The talk: its lines, the next, its look
endings
readonly endings: EndingsController;Giving up, a pause on a server
hud
readonly hud: HudApi;The HUD's own: its events, its parts, what is hidden
keys
readonly keys: Actions<GameClientApi>;The keys and what they do (the game's own actions are run with the whole client: they are the game's code)
layout
readonly layout: HudLayout;Where the player moved and scaled the HUD's parts (the layout mode)
logs
readonly logs: LogRing;What the client logged, for the debug panel's log
menu
readonly menu: PauseMenu;The pause menu: its pages, its lines (menu.run runs one)
pingWheel
readonly pingWheel: PingWheel;The ping wheel's state
portraits
readonly portraits: Portraits;The portraits: a box of the HUD's (the selection's, a speaker's), a line's face
quality
readonly quality: Quality;How much is asked of the graphics card
root
readonly root: HTMLElement;The page's element the game is drawn in
runAction
runAction(id: string): void;Runs one of the game's actions (GameView.hud.actions) by its id
runtime
readonly runtime: ClientRuntime;What the app runs with: where it keeps things in the browser
saves
readonly saves?: SavesController;The saves of where the game is played, where it has any
score
readonly score: ClientScore;The score: its stats, the players counted
session
readonly session: HudSession;The session the HUD reads: the registry, who plays, the tick rate and what the player can do
setDialogLook
setDialogLook(look: Partial<DialogLook> | null): void;Changes how the talk is drawn while the game runs; null puts the view's back
settings
readonly settings: Settings;The player's settings: read, set, put back
skipCinematic
skipCinematic(): void;Skips the cinematic playing, where it may be skipped
skipLine
skipLine(): void;Moves the talk on: the line typed out at once, or the next
sounds
readonly sounds: SoundPlayer;What the game is heard through
speed
speed: number;How fast the game goes, 0 paused; set where the player may
state
readonly state: {
readonly report: Readonly<Record<string, unknown>>;
readonly players: ReadonlyMap<PlayerId, PlayerState>;
readonly entities: {
readonly size: number;
};
};What the client knows of the world, to read: what the rules report (RuleSettings.report: a game's own part draws it), the players (their names, colours, resources), and how many entities, for the numbers of the debug tools
ui
readonly ui: Ui;What the player sees, as signals
view
readonly view: GameView;The game's view: what it says of its HUD, its looks
words
readonly words: Words;What the client says things in: the player's language, the words of a key, a message or a name in it