Skip to content

Slider

Inherits: Range < Control < CanvasItem < Entity < Object

Inherited by: HSlider, VSlider

Abstract base class for sliders.

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.

Type Name Default
bool editable true
Control.FocusMode focus_mode 2 (overrides Control)
bool scrollable true
float step 1.0 (overrides Range)
int tick_count 0
bool ticks_on_borders false
TickPosition ticks_position 0

drag_ended

drag_ended(value_changed: bool)

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

drag_started

drag_started()

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

TickPosition

enum TickPosition

TICK_POSITION_BOTTOM_RIGHT = 0

Places the ticks at the bottom of the HSlider, or right of the VSlider.

TICK_POSITION_TOP_LEFT = 1

Places the ticks at the top of the HSlider, or left of the VSlider.

TICK_POSITION_BOTH = 2

Places the ticks at the both sides of the slider.

TICK_POSITION_CENTER = 3

Places the ticks at the center of the slider.

center_grabber

int center_grabber (constant) = 0

grabber_max_size

int grabber_max_size (constant) = 0

grabber_offset

int grabber_offset (constant) = 0

tick_max_size

int tick_max_size (constant) = 0

tick_offset

int tick_offset (constant) = 0

grabber

Texture2D grabber (icon)

grabber_disabled

Texture2D grabber_disabled (icon)

grabber_highlight

Texture2D grabber_highlight (icon)

tick

Texture2D tick (icon)

drag_ended_sound

AudioStream drag_ended_sound (sound)

drag_started_sound

AudioStream drag_started_sound (sound)

focus_sound

AudioStream focus_sound (sound)

value_change_rejected_sound

AudioStream value_change_rejected_sound (sound)

value_changed_sound

AudioStream value_changed_sound (sound)

grabber_area

StyleBox grabber_area (style)

grabber_area_highlight

StyleBox grabber_area_highlight (style)

slider

StyleBox slider (style)

editable

bool editable = true

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

scrollable

bool scrollable = true

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

tick_count

int tick_count = 0

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

ticks_on_borders

bool ticks_on_borders = false

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

ticks_position

TickPosition ticks_position = 0

Sets the position of the ticks. See TickPosition for details.