Skip to content

HudWidgetDef beta ​

Interface of @v12-engine/client

ts
export interface HudWidgetDef

A part of the HUD (GameView.hud.widgets, client.hud.widgets.add): one of the game's own, or one of the client's changed by its id (HudWidget), where what is left out is the client's.

  • place and order: where it goes (HudPlace), and where among the parts there, the least first. The client's own are at tens (10, 20, 30…) in each place; one of the game's without an order comes after them - when: it is drawn only while this says so (read as a signal: what it reads of client.ui makes it come and go) - component or mount: what draws it, a Solid component or an element the game draws into. One of the client's own drawn by the game is given the client's part to wrap (HudWidgetProps.children) - section: a section the player moves and scales in the HUD's layout mode (client.layout) when left out; drawn in the flow of its place, a section still (inline), or none (false) - style: CSS for its element: where one over-map goes (top: 40px; left: 30%), or anything else about it

Members ​

component ​

ts
component?: (props: HudWidgetProps) => JSX.Element;

Draws the part as a Solid component, given the client and the part's id (HudWidgetProps)

id ​

ts
id: string;

A name of its own (td.waves), or the client's part it changes (card, clock)

mount ​

ts
mount?: PanelMount;

Puts the part into element and keeps it up to date; gives back what takes it away again. Called once it is drawn

order ​

ts
order?: number;

Sorts the parts of one place: lower first

place ​

ts
place?: HudPlace;

Where it goes. The client's own part keeps its place where left out; one of the game's must say

section ​

ts
section?: 'inline' | false;

Whether the player can move and scale it in layout mode (a section), or it sits inline in the flow of its place, or false for neither

style ​

ts
style?: string;

CSS for the part's element, such as where an over-map part goes (top: 40px; left: 30%)

when ​

ts
when?: (client: HudClient) => boolean;

Whether the part is shown now; asked as the HUD updates. Always shown when left out