Table of Contents

Class Slider

Abstract base class for sliders.

Inheritance
Slider
Derived

Remarks

Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or vertical axis. Sliders are Range-based controls.

Properties

editable

If true, the slider can be interacted with. If false, the value can be changed only by code.

var editable : bool = true

Property Value

bool

Remarks

  • void set_editable(bool value)
  • bool is_editable

scrollable

If true, the value can be changed using the mouse wheel.

var scrollable : bool = true

Property Value

bool

Remarks

  • void set_scrollable(bool value)
  • bool is_scrollable

tick_count

Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers.

var tick_count : int = 0

Property Value

int

Remarks

  • void set_ticks(int value)
  • int get_ticks

ticks_on_borders

If true, the slider will display ticks for minimum and maximum values.

var ticks_on_borders : bool = false

Property Value

bool

Remarks

  • void set_ticks_on_borders(bool value)
  • bool get_ticks_on_borders

center_grabber

Theme Property

Boolean constant. If 1, the grabber texture size will be ignored and it will fit within slider's bounds based only on its center position.

 = ``0``

Property Value

int

grabber_offset

Theme Property

Vertical or horizontal offset of the grabber.

 = ``0``

Property Value

int

grabber

Theme Property

The texture for the grabber (the draggable element).

Texture2D grabber

Property Value

Texture2D

grabber_disabled

Theme Property

The texture for the grabber when it's disabled.

Texture2D grabber_disabled

Property Value

Texture2D

grabber_highlight

Theme Property

The texture for the grabber when it's focused.

Texture2D grabber_highlight

Property Value

Texture2D

tick

Theme Property

The texture for the ticks, visible when tick_count is greater than 0.

Texture2D tick

Property Value

Texture2D

grabber_area

Theme Property

The background of the area to the left or bottom of the grabber.

StyleBox grabber_area

Property Value

StyleBox

grabber_area_highlight

Theme Property

The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused.

StyleBox grabber_area_highlight

Property Value

StyleBox

slider

Theme Property

The background for the whole slider. Affects the height or width of the grabber_area.

StyleBox slider

Property Value

StyleBox

Events

drag_ended(bool)

Emitted when the grabber stops being dragged. If value_changed is true, value is different from the value when the dragging was started.

signal drag_ended(bool value_changed)

Parameters

value_changed bool

drag_started

Emitted when the grabber starts being dragged. This is emitted before the corresponding Range.value_changed signal.

signal drag_started