Files
godot-docs/classes/class_slider.rst
2023-07-24 10:19:37 +00:00

156 lines
6.3 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.0/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-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_Slider_signal_drag_ended:
.. rst-class:: classref-signal
**drag_ended** **(** :ref:`bool<class_bool>` value_changed **)**
Emitted when dragging stops. If ``value_changed`` is true, :ref:`Range.value<class_Range_property_value>` is different from the value when you started the dragging.
.. rst-class:: classref-item-separator
----
.. _class_Slider_signal_drag_started:
.. rst-class:: classref-signal
**drag_started** **(** **)**
Emitted when dragging is started.
.. 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``
.. rst-class:: classref-property-setget
- void **set_editable** **(** :ref:`bool<class_bool>` value **)**
- :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``
.. rst-class:: classref-property-setget
- void **set_scrollable** **(** :ref:`bool<class_bool>` value **)**
- :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``
.. rst-class:: classref-property-setget
- void **set_ticks** **(** :ref:`int<class_int>` value **)**
- :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``
.. rst-class:: classref-property-setget
- void **set_ticks_on_borders** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_ticks_on_borders** **(** **)**
If ``true``, the slider will display ticks for minimum and maximum values.
.. |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.)`