Skip to content

Class: SliderComponent ​

A draggable value (Unity's Slider, Cocos's Slider). The host's UITransform is the track: a press anywhere on it jumps the value there, then it follows the drag. handle (a child) is moved to the value along the track; fill (a child) shows the track up to it — cropped if it's a Sprite with a fill type, else resized. SliderSystem keeps both in place, edit mode included.

EntityEvent.SliderChanged on the host (payload: value) whenever it changes while the game runs — dragging or code.

Extends ​

Constructors ​

Constructor ​

ts
new SliderComponent(): SliderComponent;

Returns ​

SliderComponent

Inherited from ​

Component.constructor

Properties ​

PropertyModifierTypeDefault valueInherited from
directionpublicUIFillDirectionundefined-
dirtypublicbooleantrueComponent.dirty
enabledpublicbooleantrueComponent.enabled
fillpublicnumber | nullundefined-
handlepublicnumber | nullundefined-
interactablepublicbooleanundefined-
maxValuepublicnumberundefined-
minValuepublicnumberundefined-
valuepublicnumberundefined-
wholeNumberspublicbooleanundefined-

Accessors ​

normalizedValue ​

Get Signature ​

ts
get normalizedValue(): number;

0..1 between min and max.

Returns ​

number

Set Signature ​

ts
set normalizedValue(v): void;
Parameters ​
ParameterType
vnumber
Returns ​

void

Methods ​

SetFill() ​

ts
SetFill(target): void;

Parameters ​

ParameterType
targetnumber | Entity | null

Returns ​

void


SetHandle() ​

ts
SetHandle(target): void;

Parameters ​

ParameterType
targetnumber | Entity | null

Returns ​

void

© 2026 PlayAdGentic