:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Slider.xml. .. _class_Slider: Slider ====== **Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Inherited By:** :ref:`HSlider`, :ref:`VSlider` Abstract base class for sliders. .. rst-class:: classref-introduction-group Description ----------- Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or vertical axis. Sliders are :ref:`Range`-based controls. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`editable` | ``true`` | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``2`` (overrides :ref:`Control`) | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`scrollable` | ``true`` | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`float` | step | ``1.0`` (overrides :ref:`Range`) | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`int` | :ref:`tick_count` | ``0`` | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`ticks_on_borders` | ``false`` | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`TickPosition` | :ref:`ticks_position` | ``0`` | +-----------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Theme Properties ---------------- .. table:: :widths: auto +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`center_grabber` | ``0`` | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`grabber_offset` | ``0`` | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`int` | :ref:`tick_offset` | ``0`` | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`Texture2D` | :ref:`grabber` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`Texture2D` | :ref:`grabber_disabled` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`Texture2D` | :ref:`grabber_highlight` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`Texture2D` | :ref:`tick` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`StyleBox` | :ref:`grabber_area` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`StyleBox` | :ref:`grabber_area_highlight` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ | :ref:`StyleBox` | :ref:`slider` | | +-----------------------------------+--------------------------------------------------------------------------------+-------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_Slider_signal_drag_ended: .. rst-class:: classref-signal **drag_ended**\ (\ value_changed\: :ref:`bool`\ ) :ref:`🔗` Emitted when the grabber stops being dragged. If ``value_changed`` is ``true``, :ref:`Range.value` is different from the value when the dragging was started. .. rst-class:: classref-item-separator ---- .. _class_Slider_signal_drag_started: .. rst-class:: classref-signal **drag_started**\ (\ ) :ref:`🔗` Emitted when the grabber starts being dragged. This is emitted before the corresponding :ref:`Range.value_changed` signal. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_Slider_TickPosition: .. rst-class:: classref-enumeration enum **TickPosition**: :ref:`🔗` .. _class_Slider_constant_TICK_POSITION_BOTTOM_RIGHT: .. rst-class:: classref-enumeration-constant :ref:`TickPosition` **TICK_POSITION_BOTTOM_RIGHT** = ``0`` Places the ticks at the bottom of the :ref:`HSlider`, or right of the :ref:`VSlider`. .. _class_Slider_constant_TICK_POSITION_TOP_LEFT: .. rst-class:: classref-enumeration-constant :ref:`TickPosition` **TICK_POSITION_TOP_LEFT** = ``1`` Places the ticks at the top of the :ref:`HSlider`, or left of the :ref:`VSlider`. .. _class_Slider_constant_TICK_POSITION_BOTH: .. rst-class:: classref-enumeration-constant :ref:`TickPosition` **TICK_POSITION_BOTH** = ``2`` Places the ticks at the both sides of the slider. .. _class_Slider_constant_TICK_POSITION_CENTER: .. rst-class:: classref-enumeration-constant :ref:`TickPosition` **TICK_POSITION_CENTER** = ``3`` Places the ticks at the center of the slider. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_Slider_property_editable: .. rst-class:: classref-property :ref:`bool` **editable** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_editable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_editable**\ (\ ) If ``true``, the slider can be interacted with. If ``false``, the value can be changed only by code. .. rst-class:: classref-item-separator ---- .. _class_Slider_property_scrollable: .. rst-class:: classref-property :ref:`bool` **scrollable** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_scrollable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_scrollable**\ (\ ) If ``true``, the value can be changed using the mouse wheel. .. rst-class:: classref-item-separator ---- .. _class_Slider_property_tick_count: .. rst-class:: classref-property :ref:`int` **tick_count** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_ticks**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_ticks**\ (\ ) Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. .. rst-class:: classref-item-separator ---- .. _class_Slider_property_ticks_on_borders: .. rst-class:: classref-property :ref:`bool` **ticks_on_borders** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_ticks_on_borders**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_ticks_on_borders**\ (\ ) If ``true``, the slider will display ticks for minimum and maximum values. .. rst-class:: classref-item-separator ---- .. _class_Slider_property_ticks_position: .. rst-class:: classref-property :ref:`TickPosition` **ticks_position** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_ticks_position**\ (\ value\: :ref:`TickPosition`\ ) - :ref:`TickPosition` **get_ticks_position**\ (\ ) Sets the position of the ticks. See :ref:`TickPosition` for details. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Theme Property Descriptions --------------------------- .. _class_Slider_theme_constant_center_grabber: .. rst-class:: classref-themeproperty :ref:`int` **center_grabber** = ``0`` :ref:`🔗` 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. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_constant_grabber_offset: .. rst-class:: classref-themeproperty :ref:`int` **grabber_offset** = ``0`` :ref:`🔗` Vertical or horizontal offset of the grabber. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_constant_tick_offset: .. rst-class:: classref-themeproperty :ref:`int` **tick_offset** = ``0`` :ref:`🔗` Vertical or horizontal offset of the ticks. The offset is reversed for top or left ticks. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_icon_grabber: .. rst-class:: classref-themeproperty :ref:`Texture2D` **grabber** :ref:`🔗` The texture for the grabber (the draggable element). .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_icon_grabber_disabled: .. rst-class:: classref-themeproperty :ref:`Texture2D` **grabber_disabled** :ref:`🔗` The texture for the grabber when it's disabled. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_icon_grabber_highlight: .. rst-class:: classref-themeproperty :ref:`Texture2D` **grabber_highlight** :ref:`🔗` The texture for the grabber when it's focused. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_icon_tick: .. rst-class:: classref-themeproperty :ref:`Texture2D` **tick** :ref:`🔗` The texture for the ticks, visible when :ref:`tick_count` is greater than 0. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_style_grabber_area: .. rst-class:: classref-themeproperty :ref:`StyleBox` **grabber_area** :ref:`🔗` The background of the area to the left or bottom of the grabber. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_style_grabber_area_highlight: .. rst-class:: classref-themeproperty :ref:`StyleBox` **grabber_area_highlight** :ref:`🔗` The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused. .. rst-class:: classref-item-separator ---- .. _class_Slider_theme_style_slider: .. rst-class:: classref-themeproperty :ref:`StyleBox` **slider** :ref:`🔗` The background for the whole slider. Affects the height or width of the :ref:`grabber_area`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`