HudWidgetDef beta
Interface of @v12-engine/client
export interface HudWidgetDefA 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.
placeandorder: 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 ofclient.uimakes it come and go) -componentormount: 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 oneover-mapgoes (top: 40px; left: 30%), or anything else about it
Members
component
component?: (props: HudWidgetProps) => JSX.Element;Draws the part as a Solid component, given the client and the part's id (HudWidgetProps)
id
id: string;A name of its own (td.waves), or the client's part it changes (card, clock)
mount
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
order?: number;Sorts the parts of one place: lower first
place
place?: HudPlace;Where it goes. The client's own part keeps its place where left out; one of the game's must say
section
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
style?: string;CSS for the part's element, such as where an over-map part goes (top: 40px; left: 30%)
when
when?: (client: HudClient) => boolean;Whether the part is shown now; asked as the HUD updates. Always shown when left out