hud.createBar

Section: HUD Widgets

What it does

hud.createBar creates a Bar in hud. It takes id and an options object.

Signature

hud.createBar(id, { value, max, label, color, bgColor, x, y, width, height })

Arguments

  • id
  • { value, max, label, color, bgColor, x, y, width, height }

    Keys:valuemaxlabelcolorbgColorxywidthheight

Example · generated

function start() {  hud.createBar('bar', { value: 1, max: 1, label: 'Hello' });}

hud.createBar is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.

3 members in hud