Skip to content

BarWidget beta ​

Interface of @v12-engine/client

ts
export interface BarWidget extends WidgetRules

A bar: how full it is from a part of the unit, or a number (0..1) or a function of it. xp is a hero's way to its next level: its side's (HeroSent.xp), or anyone's where the rules share it (RuleSettings.hud.shareXp)

Members ​

background ​

ts
background?: string;

CSS colour of what is empty

bar ​

ts
bar: 'health' | 'mana' | 'shield' | 'progress' | 'xp' | Value<number>;

What the bar shows: a part of the unit (health, mana, shield, progress, xp), or a number 0..1 from a function

color ​

ts
color?: Value<string>;

CSS colour of what is full: by how full for health, of its kind for the others, when left out

direction ​

ts
direction?: 'ltr' | 'rtl' | 'center';

Which way it fills: from the left (default), from the right, from the middle out

ghost ​

ts
ghost?: {
        color?: string;
        seconds?: number;
    };

What was just lost shown a while in another colour, draining to the bar (an action game's chunk of damage): its colour and the seconds it drains over. None when left out

height ​

ts
height?: number;

Pixels. 5 for health, 4 for the others

label ​

ts
label?: 'value' | 'percent' | Value<string>;

Words on the bar: the points (value: 340/500), how full (percent), or the game's own

segments ​

ts
segments?: number;

The bar cut into so many equal parts (the pips of a pool): none when left out

smooth ​

ts
smooth?: number;

Seconds over which the bar follows its value, rather than jumping to it: none when left out

ticks ​

ts
ticks?: number;

A mark every so many points of health (or mana): a MOBA's way of showing how much there is

width ​

ts
width?: Value<number>;

Pixels. As wide as the unit is big when left out