Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Slider

Slider UI element

Hierarchy

Index

Properties

onValueChanged

onValueChanged: MulticastDelegate<(slider: this, player: Player, value: number) => void>

Called when the value is changed by a player

param

The slider that was changed

param

The player who changed the value. undefined if the value was changed through setValue.

param

The new value

Methods

getMaxValue

  • getMaxValue(): number
  • Return the maximum slider value

    Returns number

getMinValue

  • getMinValue(): number
  • Return the minimum slider value

    Returns number

getOwningObject

getParent

  • getParent(): Widget | undefined
  • Return the widget that contains this widget, for example a border that wraps a check box. Returns undefined if this object has no parent.

    Returns Widget | undefined

getStepSize

  • getStepSize(): number

getTextBoxWidth

  • getTextBoxWidth(): number
  • Return the width of the text box. Default: 35

    Returns number

getValue

  • getValue(): number

isEnabled

  • isEnabled(): boolean

setEnabled

  • setEnabled(enabled: boolean): Widget
  • Set whether the widget is enabled. When a widget is disabled, users can't interact with it and it is greyed out. When a widget that contains other widgets (like VerticalBox) is disabled, all its children behave as if disabled, too. By default, widgets are enabled.

    Parameters

    • enabled: boolean

      Whether to enable the widget.

    Returns Widget

setFontSize

  • setFontSize(size: number): Slider
  • Set the font size.

    Parameters

    • size: number

      The new font size. Default: 12

    Returns Slider

setMaxValue

  • setMaxValue(maxValue: number): Slider
  • Set the maximum slider value. Default: 1

    Parameters

    • maxValue: number

    Returns Slider

setMinValue

  • setMinValue(minValue: number): Slider
  • Set the minimum slider value. Default: 0

    Parameters

    • minValue: number

    Returns Slider

setStepSize

  • setStepSize(stepSize: number): Slider
  • Set the slider step size. Default: 0.01

    Parameters

    • stepSize: number

    Returns Slider

setTextBoxWidth

  • setTextBoxWidth(width: number): Slider
  • Set the width of the text box. Can be 0 to hide the text box.

    Parameters

    • width: number

    Returns Slider

setValue

  • setValue(value: number): Slider