Skip to main content

Function: normalizeUiProgressBarValue()

normalizeUiProgressBarValue(progressBar): number

Defined in: ui/components/ui-progress-bar-component.ts:91

Normalizes progressBar.value to a 0-1 fraction of the way from minValue to maxValue - the anchor fraction createUiProgressBarEcsSystem drives the fill visual with.

Parameters​

progressBar​

Pick<UiProgressBarEcsComponent, "value" | "minValue" | "maxValue">

The progress bar's value/minValue/maxValue.

Returns​

number

The normalized fraction, clamped to [0, 1]. 0 if minValue and maxValue coincide (a zero-length range has no meaningful fraction).