Skip to content

@relu-interactives/spatial-ecs


@relu-interactives/spatial-ecs / components / UISliderComponent

Class: UISliderComponent ​

Defined in: components/UISlider.ts:35

A draggable value control.

Press and drag along the track: the value is the clamped projection of the pointer onto the track's local X. The fill and knob are separate quads positioned from value, so dragging repositions geometry and never redraws the canvas. Scripts hear changes via Behaviour.onUiChange (throttled to real value changes, plus a final dispatch on release).

Extends ​

Constructors ​

Constructor ​

ts
new UISliderComponent(options?): UISliderComponent;

Defined in: components/UISlider.ts:65

Parameters ​

ParameterType
options?UISliderOptions

Returns ​

UISliderComponent

Overrides ​

Component.constructor

Properties ​

PropertyTypeDescriptionDefined in
valuenumberCurrent value, clamped to [min, max].components/UISlider.ts:37
minnumber-components/UISlider.ts:38
maxnumber-components/UISlider.ts:39
actionIdstringDispatch identifier; empty string means "use the entity name".components/UISlider.ts:41
widthnumberFull width in metres.components/UISlider.ts:43
heightnumberFull height in metres.components/UISlider.ts:45
trackColorstring-components/UISlider.ts:46
accentColorstringFill colour between min and the current value.components/UISlider.ts:48
knobColorstring-components/UISlider.ts:49
pixelDensity?numberTexture density in px/metre, clamped 256–2048 at render time. Absent means the default: a defaulted field would count as a change on every instance of a prefab saved before it existed.components/UISlider.ts:55
style?UiStyleModern styling; wins over the flat fields above. Absent until authored.components/UISlider.ts:57
variant?UiSliderVariantHow the value is drawn. progress and ring are read-only.components/UISlider.ts:59
step?numberSnap to multiples of this, measured from min.components/UISlider.ts:61
readOnly?booleanShows the value but takes no input.components/UISlider.ts:63