Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Slider
Inherits: Range < Control < CanvasItem < Node < Object
Inherited By: HSlider, VSlider
Abstract base class for sliders.
Description
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
|
||
focus_mode |
|
|
|
||
step |
|
|
|
||
|
||
|
Theme Properties
|
||
|
||
|
||
|
||
|
||
Signals
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() 🔗
Emitted when the grabber starts being dragged. This is emitted before the corresponding Range.value_changed signal.
Enumerations
enum TickPosition: 🔗
TickPosition TICK_POSITION_BOTTOM_RIGHT = 0
Places the ticks at the bottom of the HSlider, or right of the VSlider.
TickPosition TICK_POSITION_TOP_LEFT = 1
Places the ticks at the top of the HSlider, or left of the VSlider.
TickPosition TICK_POSITION_BOTH = 2
Places the ticks at the both sides of the slider.
TickPosition TICK_POSITION_CENTER = 3
Places the ticks at the center of the slider.
Property Descriptions
If true, the slider can be interacted with. If false, the value can be changed only by code.
If true, the value can be changed using the mouse wheel.
Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers.
bool ticks_on_borders = false 🔗
If true, the slider will display ticks for minimum and maximum values.
TickPosition ticks_position = 0 🔗
void set_ticks_position(value: TickPosition)
TickPosition get_ticks_position()
Sets the position of the ticks. See TickPosition for details.
Theme Property Descriptions
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.
The maximum allowed size of the Slider's grabber icon. The grabber texture is scaled down so its widest axis is grabber_max_size and the other axis is scaled keeping the original ratio.
Vertical or horizontal offset of the grabber.
The maximum allowed size of the Slider's tick icons. The tick texture is scaled down so its widest axis is tick_max_size and the other axis is scaled keeping the original ratio.
Vertical or horizontal offset of the ticks. The offset is reversed for top or left ticks.
The texture for the grabber (the draggable element).
The texture for the grabber when it's disabled.
The texture for the grabber when it's focused.
The texture for the ticks, visible when tick_count is greater than 0.
AudioStream drag_ended_sound 🔗
Played when mouse or touch drag ends. This is also used by SpinBox when dragging over its arrows, or ColorPicker when dragging over its color wheel/rectangle.
AudioStream drag_started_sound 🔗
Played when mouse or touch drag begins. This is also used by SpinBox when dragging over its arrows, or ColorPicker when dragging over its color wheel/rectangle.
AudioStream focus_sound 🔗
Played when this Slider receives keyboard or gamepad-induced focus. Mouse or touch-induced focus does not play a focus sound.
AudioStream value_change_rejected_sound 🔗
Played when the value is attempted to be changed through keyboard or gamepad input, but the value is already at the minimum (or maximum).
AudioStream value_changed_sound 🔗
Played when the value is changed through keyboard or gamepad input. If the value is already at the minimum (or maximum), value_change_rejected_sound is played instead.
The background of the area to the left or bottom of the grabber.
StyleBox grabber_area_highlight 🔗
The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused.
The background for the whole slider. Affects the height or width of the grabber_area.