Inheritance #

Slider

- HSlider
- VSlider
Table of contents

Slider #

Node, core, not_builtin_classes

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.

Members #

var editable: bool = true#

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

var focus_mode = FOCUS_ALL#

var scrollable: bool = true#

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

var step: float = 1.0#

var tick_count: int = 0#

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

var ticks_on_borders: bool = false#

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

Methods #

Annotations #

Constants #

Constructors #

Enums #

Operators #

Signals #

signal 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.

signal drag_started()#

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

Theme Items #

self["theme_override_constants/center_grabber"] = 0 as int#

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.

self["theme_override_constants/grabber_offset"] = 0 as int#

Vertical or horizontal offset of the grabber.

self["theme_override_icons/grabber"] = icon as Texture2D#

The texture for the grabber (the draggable element).

self["theme_override_icons/grabber_disabled"] = icon as Texture2D#

The texture for the grabber when it's disabled.

self["theme_override_icons/grabber_highlight"] = icon as Texture2D#

The texture for the grabber when it's focused.

self["theme_override_icons/tick"] = icon as Texture2D#

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

self["theme_override_styles/grabber_area"] = style as StyleBox#

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

self["theme_override_styles/grabber_area_highlight"] = style as StyleBox#

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

self["theme_override_styles/slider"] = style as StyleBox#

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

Tutorials #