Skip to content

UI and HUD

The UI workspace is for in-game interface: menus, HUD counters, buttons, labels, panels, health bars, and overlays. UI is part of the game, not the editor chrome.

UI vs scene objects

Use scene objects forUse UI for
World charactersScore counters
Platforms and propsMenus
Physics objectsButtons
Pickups and hazardsDialog panels
World-space signsHealth bars and progress displays

World objects live on the scene canvas. UI elements live in interface layers that should remain readable across screen sizes.

Common UI elements

ElementUse
PanelGrouping surface for menu or HUD content
LabelScore, timer, prompt text
ButtonMenu action, retry, start, pause
ImageIcon, portrait, decorative game art
Progress barHealth, cooldown, loading, stamina
SliderSettings, volume, adjustable runtime values

The UI palette adds elements such as Panel, Text, Button, Bar, Slider, and Image.

Inspector sections

Selecting a UI element shows sections based on that element type.

SectionEdits
ElementName, visibility, input blocking
PlacementAnchor and offsets when the parent is not laying out children
SizingFixed, fill, or hug sizing inside layout parents
LayoutRow, column, grid, spacing, padding, alignment
StyleBackground, corner radius, text color, font size
ContentText, button event name, bar value, image asset, slider variable
World anchorPin the UI element to a world object's screen position

Keep HUD UI compact. A player should understand the important state while still seeing the game.

Binding UI to game state

UI becomes useful when it reflects runtime data.

Common bindings:

UIData
Score labelProject variable score, bound as self.score
Lives labelProject variable lives, bound as self.lives
Health barPlayer Health component
Objective textself.currentQuest (or self.GameState.currentQuest)
Button enabled stateA bool variable or component condition

Use GameState for values shared across scenes. Use object or component fields for values tied to one object.

UI bindings use expression strings. Project variables are available through self, and objects can be looked up with get(id).

Examples:

text
props.text = `Score ${self.score}`
props.value = self.hp
props.max = self.maxHp
visible = self.hasKey

For object-specific values, use an object lookup when you know the id:

text
props.value = get("player").hp

Bindings run after gameplay logic each frame so the HUD catches up immediately after Flow or components change state.

UI buttons and Flow

Buttons can trigger Object Flow or Scene Flow.

Examples:

ButtonGraph action
StartGo To Scene: Level 1
RetryReset GameState, reload current scene
PauseShow pause panel, stop gameplay timer
Shop itemCheck currency, subtract cost, add item
CloseHide panel

Put global navigation in Scene Flow when possible. Put button-specific feedback, sounds, and visual state on the button object.

Buttons expose an Event field. At runtime, pressing the button emits that custom event into the rule system. Listen for the same event name in Scene Flow or Object Flow.

Previewing over the scene

In the UI workspace, the stagebar Show scene toggle lays out the UI at the same stage bounds used in Play and Preview, composited over the arrange-mode scene (edit camera — not a live Play session). Leave it off to edit on the letterboxed artboard.

Responsive layout

Players may run the game on desktop, tablet, or phone-sized screens.

Good layout habits:

  • Anchor HUD elements to predictable corners or edges.
  • Keep tap targets large enough for touch.
  • Avoid long labels inside small buttons.
  • Test fullscreen play.
  • Leave room for browser UI on mobile Safari.

UI organization

Name UI roots clearly:

text
UI
  HUD
    ScoreLabel
    LivesLabel
  PauseMenu
    Panel
    ResumeButton
    RetryButton
  Dialog
    Portrait
    Text
    ContinueButton

Keep menus hidden until needed. Use flow graphs to toggle visibility.

Opal Engine — MIT licensed