Skip to content

UnitHudDef ​

Interface of @v12-engine/client

ts
export interface UnitHudDef

The HUD over a unit (GameView.units.hud.def, UnitLook.unitHud, client.unitHud): a plate with rules around it. Plates by situation (the first whose when holds), for whom, how far from the camera, at which size, how high over the unit, faded in and out. A plain UnitHudPlate is a def of one plate with no rules

Members ​

above ​

ts
above?: number;

Cells over the unit's head (its UnitLook.height) where the plate stands. 0.3 when left out

audience ​

ts
audience?: HudAudience;

For whom the whole HUD is drawn. Everyone when left out

fade ​

ts
fade?: number;

Seconds over which it fades in as it starts to show and out as it stops. 0.15 when left out (a plain UnitHudPlate: none)

far ​

ts
far?: UnitHudPlate | null;

The plate past within: a dot, a thin bar. Nothing when left out

fixedSize ​

ts
fixedSize?: boolean;

Whether the plate keeps its size on the screen (true, default) or grows and shrinks with the camera's distance

grey beta ​

ts
grey?: string | false;

A CSS filter over a remembered building's plate: grayscale(1) brightness(0.75) when left out, none for false

plates ​

ts
plates: UnitHudPlate | readonly UnitHudPlate[];

The plate, or plates picked by the first whose when holds (none drawn where none does)

remembered beta ​

ts
remembered?: 'none' | 'plate' | 'far';

What a building the player remembers under the fog shows, as it was last seen: nothing (none, default), its plate (plate, picked with when.remembered), or its far plate (far; the plate where there is none); greyed by grey. A unit the player does not see now is not drawn at all

render beta ​

ts
render?: PlateRender;

How the plate is drawn: on the overlay's canvas with the others (canvas, the cheapest: no element for each unit), as elements of the page (dom: one for the plate, one for each widget and shape, for a game that styles its plates with CSS). The same widgets, laid out the same way. The look's (UnitHudLook.render), else canvas, when left out

sizeAt ​

ts
sizeAt?: number;

Cells from the camera at which a plate that is not fixedSize is the size it says. 32 (the camera's usual) when left out

within ​

ts
within?: number;

Cells from the camera within which the plates are drawn; past it, the far plate or nothing. No limit when left out