Skip to content

HudClient ​

Interface of @v12-engine/client

ts
export interface HudClient

The 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 ​

ts
abilityTip: GameClient['abilityTip'];

What a button of an ability says of it

attachMinimap ​

ts
attachMinimap(canvas: HTMLCanvasElement): () => void;

Draws the minimap into a canvas of the HUD's; gives back what stops it

camera ​

ts
readonly camera: {
        lookAt(point: Vec2): void;
        readonly focus: Vec2;
    };

Where the view looks: a HUD's button that shows something moves it there

connection ​

ts
readonly connection: ConnectionController;

The connection to a server, where the game is played on one

controller ​

ts
readonly controller: PlayerActions;

The player's hands, as far as a HUD goes

debugTools ​

ts
readonly debugTools: DebugTools;

The debug tools: their switches, numbers, buttons and measures, where the player may use them

dialog ​

ts
readonly dialog: DialogQueue;

The talk: its lines, the next, its look

endings ​

ts
readonly endings: EndingsController;

Giving up, a pause on a server

hud ​

ts
readonly hud: HudApi;

The HUD's own: its events, its parts, what is hidden

keys ​

ts
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 ​

ts
readonly layout: HudLayout;

Where the player moved and scaled the HUD's parts (the layout mode)

logs ​

ts
readonly logs: LogRing;

What the client logged, for the debug panel's log

ts
readonly menu: PauseMenu;

The pause menu: its pages, its lines (menu.run runs one)

pingWheel ​

ts
readonly pingWheel: PingWheel;

The ping wheel's state

portraits ​

ts
readonly portraits: Portraits;

The portraits: a box of the HUD's (the selection's, a speaker's), a line's face

quality ​

ts
readonly quality: Quality;

How much is asked of the graphics card

root ​

ts
readonly root: HTMLElement;

The page's element the game is drawn in

runAction ​

ts
runAction(id: string): void;

Runs one of the game's actions (GameView.hud.actions) by its id

runtime ​

ts
readonly runtime: ClientRuntime;

What the app runs with: where it keeps things in the browser

saves ​

ts
readonly saves?: SavesController;

The saves of where the game is played, where it has any

score ​

ts
readonly score: ClientScore;

The score: its stats, the players counted

session ​

ts
readonly session: HudSession;

The session the HUD reads: the registry, who plays, the tick rate and what the player can do

setDialogLook ​

ts
setDialogLook(look: Partial<DialogLook> | null): void;

Changes how the talk is drawn while the game runs; null puts the view's back

settings ​

ts
readonly settings: Settings;

The player's settings: read, set, put back

skipCinematic ​

ts
skipCinematic(): void;

Skips the cinematic playing, where it may be skipped

skipLine ​

ts
skipLine(): void;

Moves the talk on: the line typed out at once, or the next

sounds ​

ts
readonly sounds: SoundPlayer;

What the game is heard through

speed ​

ts
speed: number;

How fast the game goes, 0 paused; set where the player may

state ​

ts
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 ​

ts
readonly ui: Ui;

What the player sees, as signals

view ​

ts
readonly view: GameView;

The game's view: what it says of its HUD, its looks

words ​

ts
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