ui.createPanel

Section: UI (HUD)

What it does

ui.createPanel creates a Panel in ui. It takes id and an options object.

Signature

ui.createPanel(id, { x, y, width, height, bgColor, borderRadius })

Arguments

  • id
  • { x, y, width, height, bgColor, borderRadius }

    Keys:xywidthheightbgColorborderRadius

Example · generated

function start() {  ui.createPanel('panel', { x: 100, y: 120, width: 2 });}

ui.createPanel 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.

13 members in ui