Skip to main content

Function: createProgressBar()

createProgressBar(world, parent, options): ProgressBar

Defined in: ui/utilities/create-progress-bar.ts:91

Creates a progress bar: a panel (see createPanel) used as the background/track, plus a child fill panel whose rect transform createUiProgressBarEcsSystem drives from value every tick. Purely visual - unlike createSlider, no UiInteractableEcsComponent is added, since a progress bar reports state rather than accepting input.

Parameters​

world​

EcsWorld

The ECS world to create the progress bar entity in.

parent​

number

The parent entity - a canvas (see createUiCanvas) or another UI element.

options​

CreateProgressBarOptions

Options for configuring the progress bar. trackSprite and fillSprite have no sensible default and must always be provided.

Returns​

ProgressBar

The created progress bar: its track entity, its child fill entity, and its UiProgressBarEcsComponent.