hex(c: { number }) → string
| arg | type | description |
|---|
| c | { number } | |
rgbOf(h: string) → string
"r,g,b" (0..255) of a "#rrggbb" colour, for rgba() glows.
| arg | type | description |
|---|
| h | string | |
teamColor(rgb: any) → string
A design paint colour as a HUD colour: the hex of `rgb`, lifted toward grey when it is too dark to read on black.
slotColor(slot: string) → string
The HUD colour of a corner: its design's primary paint (Rules.design(slot)), lifted when too dark.
| arg | type | description |
|---|
| slot | string | |
xml(s: string) → string
Escape text for an SVG <text> body.
| arg | type | description |
|---|
| s | string | |
px(m: any, base: number, min: number?) → number
| arg | type | description |
|---|
| m | any | |
| base | number | |
| min | number? | |
merge(a: any, b: any?) → any
| arg | type | description |
|---|
| a | any | |
| b | any? | |
stripes(size: number) → string
| arg | type | description |
|---|
| size | number | |
fullFrame(id: string, m: any, children: { any }) → any
A full-viewport transparent frame holding absolutely placed children.
| arg | type | description |
|---|
| id | string | |
| m | any | |
| children | { any } | |
vignette(m: any, id: string, side: string, frac: number) → any
A soft black broadcast vignette across the top or bottom of the frame.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| side | string | |
| frac | number | |
entrance(delay: number, from: string) → any
A one-shot entrance animation (fade in from a transform).
| arg | type | description |
|---|
| delay | number | |
| from | string | |
pulse(scale: number, period: number) → any
| arg | type | description |
|---|
| scale | number | |
| period | number | |
small(m: any, color: string, extra: any?) → any
Small broadcast caption type.
| arg | type | description |
|---|
| m | any | |
| color | string | |
| extra | any? | |
trimmed(id: string, trimColor: string, trim: number, clip: string, outer: any, inner: any, children: { any }) → any
A trimmed panel: an outer box in the trim colour clipped to `clip`, and an
inner black box inset by `trim` with the same clip, so diagonal edges keep
their trim (a CSS border would be cut off by the clip).
| arg | type | description |
|---|
| id | string | |
| trimColor | string | |
| trim | number | |
| clip | string | |
| outer | any | |
| inner | any | |
| children | { any } | |
stripeStrip(m: any, id: string, h: number, w: number) → any
| arg | type | description |
|---|
| m | any | |
| id | string | |
| h | number | |
| w | number | |
defs(top: number, bottom: number) → string
| arg | type | description |
|---|
| top | number | |
| bottom | number | |
display(x: number, y: number, size: number, body: string, face: string, spacing: number) → string
Extruded, outlined, gradient-faced display text. `face` is the fill of the
face layer (a gradient url or tspans carrying their own fills).
| arg | type | description |
|---|
| x | number | |
| y | number | |
| size | number | |
| body | string | |
| face | string | |
| spacing | number | |
logoSvg( ) → string
The BATTLEBOX logo: chrome BATTLE, hazard-yellow BOX, extruded and outlined, with yellow rule ends.
resultHeadlineSvg(text: string) → string
The result headline (KNOCKOUT! / JUDGES' DECISION) on a dark slanted plate with a red neon edge.
| arg | type | description |
|---|
| text | string | |
bannerSvg(text: string) → string
The black, yellow-edged '<BOT> WINS' banner.
| arg | type | description |
|---|
| text | string | |
chassisSvg(color: string) → string
| arg | type | description |
|---|
| color | string | |
subtitle(m: any, id: string, text: string) → any
ROBOT COMBAT ARENA between two hazard-yellow rules.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| text | string | |
confirmButton(m: any, id: string, text: string, ready: boolean, delay: number, onClick: string?, width: number?, hint: string?) → any
The hazard-striped confirm button (PRESS ENTER TO FIGHT / FOR REMATCH); onClick = "bb_confirm" unless `onClick` names another callback; `width` overrides the default width.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| text | string | |
| ready | boolean | |
| delay | number | |
| onClick | string? | |
| width | number? | |
| hint | string? | |
namePlate(m: any, id: string, name: string, color: string, sub: string, mirrored: boolean) → any
A faceoff name plate: the bot's name in its paint colour over a black slanted plate.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| name | string | |
| color | string | |
| sub | string | |
| mirrored | boolean | |
clockPanel(m: any, clock: string, urgent: boolean, x: number, y: number, w: number) → any
The big digital match clock in its yellow-trimmed hex plate.
| arg | type | description |
|---|
| m | any | |
| clock | string | |
| urgent | boolean | |
| x | number | |
| y | number | |
| w | number | |
statusHeader(m: any, id: string, text: string) → any
| arg | type | description |
|---|
| m | any | |
| id | string | |
| text | string | |
weaponPanel(m: any, pct: number, rpm: number, x: number, y: number, w: number, line1: string?, line2: string?, unit: string?) → any
HAVOC's weapon status: spinning disc icon, DISC SPINNER, % of max RPM and the RPM.
| arg | type | description |
|---|
| m | any | |
| pct | number | |
| rpm | number | |
| x | number | |
| y | number | |
| w | number | |
| line1 | string? | |
| line2 | string? | |
| unit | string? | |
drivePanel(m: any, status: string, color: string, x: number, y: number, w: number) → any
HAVOC's drive status: chassis icon and OK / FLIPPED / STUCK / IMMOBILE / DESTROYED.
| arg | type | description |
|---|
| m | any | |
| status | string | |
| color | string | |
| x | number | |
| y | number | |
| w | number | |
centered(m: any, id: string, children: { any }) → any
| arg | type | description |
|---|
| m | any | |
| id | string | |
| children | { any } | |
centerBig(m: any, id: string, text: string, color: string, caption: string?, high: boolean?) → any
A huge centre number (3-2-1 or the KO 10-count) that slams in, with an optional caption plate. `high` hangs it under the clock instead, clear of the player's bot in the chase shot.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| text | string | |
| color | string | |
| caption | string? | |
| high | boolean? | |
centerHeadline(m: any, id: string, text: string) → any
FIGHT! in chrome and hazard yellow, popping in at the bell.
| arg | type | description |
|---|
| m | any | |
| id | string | |
| text | string | |
scoreCard(m: any, slot: string, name: string, color: string, damage: number, health: number, winner: boolean) → any
| arg | type | description |
|---|
| m | any | |
| slot | string | |
| name | string | |
| color | string | |
| damage | number | |
| health | number | |
| winner | boolean | |
scoreCards(m: any, v: any) → any
The judges' scorecards: both bots' damage dealt and health left, winner lit.
| arg | type | description |
|---|
| m | any | |
| v | any | |
outcomeChip(m: any, won: boolean) → any
YOU WIN / YOU LOSE chip above the rematch prompt.
| arg | type | description |
|---|
| m | any | |
| won | boolean | |