Skip to main content

Interface: CreateSliderDefaultedOptions

Defined in: ui/utilities/create-slider.ts:49

Fields of CreateSliderOptions with a sensible default, or that are genuinely optional (no default at all); callers may omit these.

Properties​

anchor​

anchor: UiAnchorConfig

Defined in: ui/utilities/create-slider.ts:55

The anchor to place the track with - see UiAnchor for common presets (e.g. UiAnchor.center({ x: 300, y: 24 })). Defaults to UiAnchor.center({ x: 300, y: 24 }).


anchoredPosition?​

optional anchoredPosition?: Vector2

Defined in: ui/utilities/create-slider.ts:58

Offset of the track's pivot from its anchor reference point, in reference pixels.


fillSprite?​

optional fillSprite?: SpriteEcsComponent

Defined in: ui/utilities/create-slider.ts:71

The sprite to draw an optional fill visual with - a child rect stretch-anchored from the track's left edge to the handle's position. Omitted, the slider has no fill visual (just a track and a handle).


handleSize​

handleSize: Vector2

Defined in: ui/utilities/create-slider.ts:64

The handle's size in reference pixels. Defaults to 24x24.


interactable?​

optional interactable?: Partial<UiInteractableDefaultedOptions>

Defined in: ui/utilities/create-slider.ts:91

Overrides for the track's UiInteractableEcsComponent. dragThreshold defaults to 0 here (rather than UiInteractableEcsComponent's own default of 8), so any drag at all - not just one past a dead zone - moves the handle.


maxValue​

maxValue: number

Defined in: ui/utilities/create-slider.ts:77

The value value maps to at the track's right edge. Defaults to 1.


minValue​

minValue: number

Defined in: ui/utilities/create-slider.ts:74

The value value maps to at the track's left edge. Defaults to 0.


slices?​

optional slices?: NineSliceOptions

Defined in: ui/utilities/create-slider.ts:61

Overrides trackSprite.slices for the track.


transition?​

optional transition?: Partial<UiColorTransitionDefaultedOptions>

Defined in: ui/utilities/create-slider.ts:99

Overrides for the track's UiColorTransitionEcsComponent (its hover/pressed/disabled tints, transition duration, and easing) - the only visual feedback for a slider being keyboard/gamepad-focused, since the track itself has no separate "focused" decoration.


value​

value: number

Defined in: ui/utilities/create-slider.ts:80

The slider's initial value, clamped to [minValue, maxValue]. Defaults to minValue.


wholeNumbers​

wholeNumbers: boolean

Defined in: ui/utilities/create-slider.ts:83

Rounds value to the nearest whole number whenever it's set by a drag. Defaults to false.