123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- :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<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`HSlider<class_HSlider>`, :ref:`VSlider<class_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<class_Range>`-based controls.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`editable<class_Slider_property_editable>` | ``true`` |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`scrollable<class_Slider_property_scrollable>` | ``true`` |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`float<class_float>` | step | ``1.0`` (overrides :ref:`Range<class_Range_property_step>`) |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`tick_count<class_Slider_property_tick_count>` | ``0`` |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`ticks_on_borders<class_Slider_property_ticks_on_borders>` | ``false`` |
- +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Theme Properties
- ----------------
- .. table::
- :widths: auto
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`int<class_int>` | :ref:`center_grabber<class_Slider_theme_constant_center_grabber>` | ``0`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`int<class_int>` | :ref:`grabber_offset<class_Slider_theme_constant_grabber_offset>` | ``0`` |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber<class_Slider_theme_icon_grabber>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber_disabled<class_Slider_theme_icon_grabber_disabled>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber_highlight<class_Slider_theme_icon_grabber_highlight>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`tick<class_Slider_theme_icon_tick>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`grabber_area<class_Slider_theme_style_grabber_area>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`grabber_area_highlight<class_Slider_theme_style_grabber_area_highlight>` | |
- +-----------------------------------+--------------------------------------------------------------------------------+-------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`slider<class_Slider_theme_style_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<class_bool>`\ ) :ref:`🔗<class_Slider_signal_drag_ended>`
- Emitted when the grabber stops being dragged. If ``value_changed`` is ``true``, :ref:`Range.value<class_Range_property_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:`🔗<class_Slider_signal_drag_started>`
- Emitted when the grabber starts being dragged. This is emitted before the corresponding :ref:`Range.value_changed<class_Range_signal_value_changed>` signal.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Slider_property_editable:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **editable** = ``true`` :ref:`🔗<class_Slider_property_editable>`
- .. rst-class:: classref-property-setget
- - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_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<class_bool>` **scrollable** = ``true`` :ref:`🔗<class_Slider_property_scrollable>`
- .. rst-class:: classref-property-setget
- - |void| **set_scrollable**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_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<class_int>` **tick_count** = ``0`` :ref:`🔗<class_Slider_property_tick_count>`
- .. rst-class:: classref-property-setget
- - |void| **set_ticks**\ (\ value\: :ref:`int<class_int>`\ )
- - :ref:`int<class_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<class_bool>` **ticks_on_borders** = ``false`` :ref:`🔗<class_Slider_property_ticks_on_borders>`
- .. rst-class:: classref-property-setget
- - |void| **set_ticks_on_borders**\ (\ value\: :ref:`bool<class_bool>`\ )
- - :ref:`bool<class_bool>` **get_ticks_on_borders**\ (\ )
- If ``true``, the slider will display ticks for minimum and maximum values.
- .. 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<class_int>` **center_grabber** = ``0`` :ref:`🔗<class_Slider_theme_constant_center_grabber>`
- 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<class_int>` **grabber_offset** = ``0`` :ref:`🔗<class_Slider_theme_constant_grabber_offset>`
- Vertical or horizontal offset of the grabber.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Slider_theme_icon_grabber:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **grabber** :ref:`🔗<class_Slider_theme_icon_grabber>`
- 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<class_Texture2D>` **grabber_disabled** :ref:`🔗<class_Slider_theme_icon_grabber_disabled>`
- 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<class_Texture2D>` **grabber_highlight** :ref:`🔗<class_Slider_theme_icon_grabber_highlight>`
- 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<class_Texture2D>` **tick** :ref:`🔗<class_Slider_theme_icon_tick>`
- The texture for the ticks, visible when :ref:`tick_count<class_Slider_property_tick_count>` is greater than 0.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Slider_theme_style_grabber_area:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **grabber_area** :ref:`🔗<class_Slider_theme_style_grabber_area>`
- 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<class_StyleBox>` **grabber_area_highlight** :ref:`🔗<class_Slider_theme_style_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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Slider_theme_style_slider:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **slider** :ref:`🔗<class_Slider_theme_style_slider>`
- The background for the whole slider. Affects the height or width of the :ref:`grabber_area<class_Slider_theme_style_grabber_area>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |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.)`
|