Skip to main content

Function: normalizeUiSliderValue()

normalizeUiSliderValue(slider): number

Defined in: ui/components/ui-slider-component.ts:111

Normalizes slider.value to a 0-1 fraction of the way from minValue to maxValue - the anchor fraction createUiSliderEcsSystem drives the handle/fill visuals with.

Parameters​

slider​

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

The slider'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).