BarWidget beta
Interface of @v12-engine/client
export interface BarWidget extends WidgetRulesA 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
background?: string;CSS colour of what is empty
bar
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
color?: Value<string>;CSS colour of what is full: by how full for health, of its kind for the others, when left out
direction
direction?: 'ltr' | 'rtl' | 'center';Which way it fills: from the left (default), from the right, from the middle out
ghost
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
height?: number;Pixels. 5 for health, 4 for the others
label
label?: 'value' | 'percent' | Value<string>;Words on the bar: the points (value: 340/500), how full (percent), or the game's own
segments
segments?: number;The bar cut into so many equal parts (the pips of a pool): none when left out
smooth
smooth?: number;Seconds over which the bar follows its value, rather than jumping to it: none when left out
ticks
ticks?: number;A mark every so many points of health (or mana): a MOBA's way of showing how much there is
width
width?: Value<number>;Pixels. As wide as the unit is big when left out