class_slider.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Slider.xml.
  6. .. _class_Slider:
  7. Slider
  8. ======
  9. **Inherits:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`HSlider<class_HSlider>`, :ref:`VSlider<class_VSlider>`
  11. Abstract base class for sliders.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. 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.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`editable<class_Slider_property_editable>` | ``true`` |
  23. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  24. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  25. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`scrollable<class_Slider_property_scrollable>` | ``true`` |
  27. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | step | ``1.0`` (overrides :ref:`Range<class_Range_property_step>`) |
  29. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  30. | :ref:`int<class_int>` | :ref:`tick_count<class_Slider_property_tick_count>` | ``0`` |
  31. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  32. | :ref:`bool<class_bool>` | :ref:`ticks_on_borders<class_Slider_property_ticks_on_borders>` | ``false`` |
  33. +------------------------------------------+-----------------------------------------------------------------+---------------------------------------------------------------------+
  34. .. rst-class:: classref-reftable-group
  35. Theme Properties
  36. ----------------
  37. .. table::
  38. :widths: auto
  39. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  40. | :ref:`int<class_int>` | :ref:`center_grabber<class_Slider_theme_constant_center_grabber>` | ``0`` |
  41. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  42. | :ref:`int<class_int>` | :ref:`grabber_offset<class_Slider_theme_constant_grabber_offset>` | ``0`` |
  43. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  44. | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber<class_Slider_theme_icon_grabber>` | |
  45. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  46. | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber_disabled<class_Slider_theme_icon_grabber_disabled>` | |
  47. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  48. | :ref:`Texture2D<class_Texture2D>` | :ref:`grabber_highlight<class_Slider_theme_icon_grabber_highlight>` | |
  49. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  50. | :ref:`Texture2D<class_Texture2D>` | :ref:`tick<class_Slider_theme_icon_tick>` | |
  51. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  52. | :ref:`StyleBox<class_StyleBox>` | :ref:`grabber_area<class_Slider_theme_style_grabber_area>` | |
  53. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  54. | :ref:`StyleBox<class_StyleBox>` | :ref:`grabber_area_highlight<class_Slider_theme_style_grabber_area_highlight>` | |
  55. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  56. | :ref:`StyleBox<class_StyleBox>` | :ref:`slider<class_Slider_theme_style_slider>` | |
  57. +-----------------------------------+--------------------------------------------------------------------------------+-------+
  58. .. rst-class:: classref-section-separator
  59. ----
  60. .. rst-class:: classref-descriptions-group
  61. Signals
  62. -------
  63. .. _class_Slider_signal_drag_ended:
  64. .. rst-class:: classref-signal
  65. **drag_ended**\ (\ value_changed\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_Slider_signal_drag_ended>`
  66. 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.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_Slider_signal_drag_started:
  70. .. rst-class:: classref-signal
  71. **drag_started**\ (\ ) :ref:`🔗<class_Slider_signal_drag_started>`
  72. Emitted when the grabber starts being dragged. This is emitted before the corresponding :ref:`Range.value_changed<class_Range_signal_value_changed>` signal.
  73. .. rst-class:: classref-section-separator
  74. ----
  75. .. rst-class:: classref-descriptions-group
  76. Property Descriptions
  77. ---------------------
  78. .. _class_Slider_property_editable:
  79. .. rst-class:: classref-property
  80. :ref:`bool<class_bool>` **editable** = ``true`` :ref:`🔗<class_Slider_property_editable>`
  81. .. rst-class:: classref-property-setget
  82. - |void| **set_editable**\ (\ value\: :ref:`bool<class_bool>`\ )
  83. - :ref:`bool<class_bool>` **is_editable**\ (\ )
  84. If ``true``, the slider can be interacted with. If ``false``, the value can be changed only by code.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_Slider_property_scrollable:
  88. .. rst-class:: classref-property
  89. :ref:`bool<class_bool>` **scrollable** = ``true`` :ref:`🔗<class_Slider_property_scrollable>`
  90. .. rst-class:: classref-property-setget
  91. - |void| **set_scrollable**\ (\ value\: :ref:`bool<class_bool>`\ )
  92. - :ref:`bool<class_bool>` **is_scrollable**\ (\ )
  93. If ``true``, the value can be changed using the mouse wheel.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_Slider_property_tick_count:
  97. .. rst-class:: classref-property
  98. :ref:`int<class_int>` **tick_count** = ``0`` :ref:`🔗<class_Slider_property_tick_count>`
  99. .. rst-class:: classref-property-setget
  100. - |void| **set_ticks**\ (\ value\: :ref:`int<class_int>`\ )
  101. - :ref:`int<class_int>` **get_ticks**\ (\ )
  102. Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_Slider_property_ticks_on_borders:
  106. .. rst-class:: classref-property
  107. :ref:`bool<class_bool>` **ticks_on_borders** = ``false`` :ref:`🔗<class_Slider_property_ticks_on_borders>`
  108. .. rst-class:: classref-property-setget
  109. - |void| **set_ticks_on_borders**\ (\ value\: :ref:`bool<class_bool>`\ )
  110. - :ref:`bool<class_bool>` **get_ticks_on_borders**\ (\ )
  111. If ``true``, the slider will display ticks for minimum and maximum values.
  112. .. rst-class:: classref-section-separator
  113. ----
  114. .. rst-class:: classref-descriptions-group
  115. Theme Property Descriptions
  116. ---------------------------
  117. .. _class_Slider_theme_constant_center_grabber:
  118. .. rst-class:: classref-themeproperty
  119. :ref:`int<class_int>` **center_grabber** = ``0`` :ref:`🔗<class_Slider_theme_constant_center_grabber>`
  120. 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.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_Slider_theme_constant_grabber_offset:
  124. .. rst-class:: classref-themeproperty
  125. :ref:`int<class_int>` **grabber_offset** = ``0`` :ref:`🔗<class_Slider_theme_constant_grabber_offset>`
  126. Vertical or horizontal offset of the grabber.
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_Slider_theme_icon_grabber:
  130. .. rst-class:: classref-themeproperty
  131. :ref:`Texture2D<class_Texture2D>` **grabber** :ref:`🔗<class_Slider_theme_icon_grabber>`
  132. The texture for the grabber (the draggable element).
  133. .. rst-class:: classref-item-separator
  134. ----
  135. .. _class_Slider_theme_icon_grabber_disabled:
  136. .. rst-class:: classref-themeproperty
  137. :ref:`Texture2D<class_Texture2D>` **grabber_disabled** :ref:`🔗<class_Slider_theme_icon_grabber_disabled>`
  138. The texture for the grabber when it's disabled.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_Slider_theme_icon_grabber_highlight:
  142. .. rst-class:: classref-themeproperty
  143. :ref:`Texture2D<class_Texture2D>` **grabber_highlight** :ref:`🔗<class_Slider_theme_icon_grabber_highlight>`
  144. The texture for the grabber when it's focused.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_Slider_theme_icon_tick:
  148. .. rst-class:: classref-themeproperty
  149. :ref:`Texture2D<class_Texture2D>` **tick** :ref:`🔗<class_Slider_theme_icon_tick>`
  150. The texture for the ticks, visible when :ref:`tick_count<class_Slider_property_tick_count>` is greater than 0.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_Slider_theme_style_grabber_area:
  154. .. rst-class:: classref-themeproperty
  155. :ref:`StyleBox<class_StyleBox>` **grabber_area** :ref:`🔗<class_Slider_theme_style_grabber_area>`
  156. The background of the area to the left or bottom of the grabber.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_Slider_theme_style_grabber_area_highlight:
  160. .. rst-class:: classref-themeproperty
  161. :ref:`StyleBox<class_StyleBox>` **grabber_area_highlight** :ref:`🔗<class_Slider_theme_style_grabber_area_highlight>`
  162. The background of the area to the left or bottom of the grabber that displays when it's being hovered or focused.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_Slider_theme_style_slider:
  166. .. rst-class:: classref-themeproperty
  167. :ref:`StyleBox<class_StyleBox>` **slider** :ref:`🔗<class_Slider_theme_style_slider>`
  168. The background for the whole slider. Affects the height or width of the :ref:`grabber_area<class_Slider_theme_style_grabber_area>`.
  169. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  170. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  171. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  172. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  173. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  174. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  175. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  176. .. |void| replace:: :abbr:`void (No return value.)`