class_editorspinslider.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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/EditorSpinSlider.xml.
  6. .. _class_EditorSpinSlider:
  7. EditorSpinSlider
  8. ================
  9. **Inherits:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Godot editor's control for editing numeric values.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This :ref:`Control<class_Control>` node is used in the editor's Inspector dock to allow editing of numeric values. Can be used with :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` to recreate the same behavior.
  15. If the :ref:`Range.step<class_Range_property_step>` value is ``1``, the **EditorSpinSlider** will display up/down arrows, similar to :ref:`SpinBox<class_SpinBox>`. If the :ref:`Range.step<class_Range_property_step>` value is not ``1``, a slider will be displayed instead.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  22. | :ref:`ControlState<enum_EditorSpinSlider_ControlState>` | :ref:`control_state<class_EditorSpinSlider_property_control_state>` | ``0`` |
  23. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`editing_integer<class_EditorSpinSlider_property_editing_integer>` | ``false`` |
  25. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`flat<class_EditorSpinSlider_property_flat>` | ``false`` |
  27. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  28. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  29. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`hide_slider<class_EditorSpinSlider_property_hide_slider>` | ``false`` |
  31. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  32. | :ref:`String<class_String>` | :ref:`label<class_EditorSpinSlider_property_label>` | ``""`` |
  33. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  34. | :ref:`bool<class_bool>` | :ref:`read_only<class_EditorSpinSlider_property_read_only>` | ``false`` |
  35. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  36. | |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | size_flags_vertical | ``1`` (overrides :ref:`Control<class_Control_property_size_flags_vertical>`) |
  37. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | step | ``1.0`` (overrides :ref:`Range<class_Range_property_step>`) |
  39. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  40. | :ref:`String<class_String>` | :ref:`suffix<class_EditorSpinSlider_property_suffix>` | ``""`` |
  41. +---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
  42. .. rst-class:: classref-reftable-group
  43. Theme Properties
  44. ----------------
  45. .. table::
  46. :widths: auto
  47. +-----------------------------------+---------------------------------------------------------------------------+
  48. | :ref:`Texture2D<class_Texture2D>` | :ref:`updown<class_EditorSpinSlider_theme_icon_updown>` |
  49. +-----------------------------------+---------------------------------------------------------------------------+
  50. | :ref:`Texture2D<class_Texture2D>` | :ref:`updown_disabled<class_EditorSpinSlider_theme_icon_updown_disabled>` |
  51. +-----------------------------------+---------------------------------------------------------------------------+
  52. .. rst-class:: classref-section-separator
  53. ----
  54. .. rst-class:: classref-descriptions-group
  55. Signals
  56. -------
  57. .. _class_EditorSpinSlider_signal_grabbed:
  58. .. rst-class:: classref-signal
  59. **grabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_grabbed>`
  60. Emitted when the spinner/slider is grabbed.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_EditorSpinSlider_signal_ungrabbed:
  64. .. rst-class:: classref-signal
  65. **ungrabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_ungrabbed>`
  66. Emitted when the spinner/slider is ungrabbed.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_EditorSpinSlider_signal_updown_pressed:
  70. .. rst-class:: classref-signal
  71. **updown_pressed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_updown_pressed>`
  72. Emitted when the updown button is pressed.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_EditorSpinSlider_signal_value_focus_entered:
  76. .. rst-class:: classref-signal
  77. **value_focus_entered**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_value_focus_entered>`
  78. Emitted when the value form gains focus.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_EditorSpinSlider_signal_value_focus_exited:
  82. .. rst-class:: classref-signal
  83. **value_focus_exited**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_value_focus_exited>`
  84. Emitted when the value form loses focus.
  85. .. rst-class:: classref-section-separator
  86. ----
  87. .. rst-class:: classref-descriptions-group
  88. Enumerations
  89. ------------
  90. .. _enum_EditorSpinSlider_ControlState:
  91. .. rst-class:: classref-enumeration
  92. enum **ControlState**: :ref:`🔗<enum_EditorSpinSlider_ControlState>`
  93. .. _class_EditorSpinSlider_constant_CONTROL_STATE_DEFAULT:
  94. .. rst-class:: classref-enumeration-constant
  95. :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_DEFAULT** = ``0``
  96. The type of control used will depend on the value of :ref:`editing_integer<class_EditorSpinSlider_property_editing_integer>`. Up-down arrows if ``true``, a slider if ``false``.
  97. .. _class_EditorSpinSlider_constant_CONTROL_STATE_PREFER_SLIDER:
  98. .. rst-class:: classref-enumeration-constant
  99. :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_PREFER_SLIDER** = ``1``
  100. A slider will always be used, even if :ref:`editing_integer<class_EditorSpinSlider_property_editing_integer>` is enabled.
  101. .. _class_EditorSpinSlider_constant_CONTROL_STATE_HIDE:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_HIDE** = ``2``
  104. Neither the up-down arrows nor the slider will be shown.
  105. .. rst-class:: classref-section-separator
  106. ----
  107. .. rst-class:: classref-descriptions-group
  108. Property Descriptions
  109. ---------------------
  110. .. _class_EditorSpinSlider_property_control_state:
  111. .. rst-class:: classref-property
  112. :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **control_state** = ``0`` :ref:`🔗<class_EditorSpinSlider_property_control_state>`
  113. .. rst-class:: classref-property-setget
  114. - |void| **set_control_state**\ (\ value\: :ref:`ControlState<enum_EditorSpinSlider_ControlState>`\ )
  115. - :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **get_control_state**\ (\ )
  116. The state in which the control used to manipulate the value will be.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_EditorSpinSlider_property_editing_integer:
  120. .. rst-class:: classref-property
  121. :ref:`bool<class_bool>` **editing_integer** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_editing_integer>`
  122. .. rst-class:: classref-property-setget
  123. - |void| **set_editing_integer**\ (\ value\: :ref:`bool<class_bool>`\ )
  124. - :ref:`bool<class_bool>` **is_editing_integer**\ (\ )
  125. If ``true``, the **EditorSpinSlider** is considered to be editing an integer value. If ``false``, the **EditorSpinSlider** is considered to be editing a floating-point value. This is used to determine whether a slider should be drawn by default. The slider is only drawn for floats; integers use up-down arrows similar to :ref:`SpinBox<class_SpinBox>` instead, unless :ref:`control_state<class_EditorSpinSlider_property_control_state>` is set to :ref:`CONTROL_STATE_PREFER_SLIDER<class_EditorSpinSlider_constant_CONTROL_STATE_PREFER_SLIDER>`. It will also use :ref:`EditorSettings.interface/inspector/integer_drag_speed<class_EditorSettings_property_interface/inspector/integer_drag_speed>` instead of :ref:`EditorSettings.interface/inspector/float_drag_speed<class_EditorSettings_property_interface/inspector/float_drag_speed>` if the slider is available.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_EditorSpinSlider_property_flat:
  129. .. rst-class:: classref-property
  130. :ref:`bool<class_bool>` **flat** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_flat>`
  131. .. rst-class:: classref-property-setget
  132. - |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
  133. - :ref:`bool<class_bool>` **is_flat**\ (\ )
  134. If ``true``, the slider will not draw background.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_EditorSpinSlider_property_hide_slider:
  138. .. rst-class:: classref-property
  139. :ref:`bool<class_bool>` **hide_slider** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_hide_slider>`
  140. .. rst-class:: classref-property-setget
  141. - |void| **set_hide_slider**\ (\ value\: :ref:`bool<class_bool>`\ )
  142. - :ref:`bool<class_bool>` **is_hiding_slider**\ (\ )
  143. **Deprecated:** Use :ref:`control_state<class_EditorSpinSlider_property_control_state>` instead.
  144. If ``true``, the slider and up/down arrows are hidden.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_EditorSpinSlider_property_label:
  148. .. rst-class:: classref-property
  149. :ref:`String<class_String>` **label** = ``""`` :ref:`🔗<class_EditorSpinSlider_property_label>`
  150. .. rst-class:: classref-property-setget
  151. - |void| **set_label**\ (\ value\: :ref:`String<class_String>`\ )
  152. - :ref:`String<class_String>` **get_label**\ (\ )
  153. The text that displays to the left of the value.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_EditorSpinSlider_property_read_only:
  157. .. rst-class:: classref-property
  158. :ref:`bool<class_bool>` **read_only** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_read_only>`
  159. .. rst-class:: classref-property-setget
  160. - |void| **set_read_only**\ (\ value\: :ref:`bool<class_bool>`\ )
  161. - :ref:`bool<class_bool>` **is_read_only**\ (\ )
  162. If ``true``, the slider can't be interacted with.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_EditorSpinSlider_property_suffix:
  166. .. rst-class:: classref-property
  167. :ref:`String<class_String>` **suffix** = ``""`` :ref:`🔗<class_EditorSpinSlider_property_suffix>`
  168. .. rst-class:: classref-property-setget
  169. - |void| **set_suffix**\ (\ value\: :ref:`String<class_String>`\ )
  170. - :ref:`String<class_String>` **get_suffix**\ (\ )
  171. The suffix to display after the value (in a faded color). This should generally be a plural word. You may have to use an abbreviation if the suffix is too long to be displayed.
  172. .. rst-class:: classref-section-separator
  173. ----
  174. .. rst-class:: classref-descriptions-group
  175. Theme Property Descriptions
  176. ---------------------------
  177. .. _class_EditorSpinSlider_theme_icon_updown:
  178. .. rst-class:: classref-themeproperty
  179. :ref:`Texture2D<class_Texture2D>` **updown** :ref:`🔗<class_EditorSpinSlider_theme_icon_updown>`
  180. Single texture representing both the up and down buttons.
  181. .. rst-class:: classref-item-separator
  182. ----
  183. .. _class_EditorSpinSlider_theme_icon_updown_disabled:
  184. .. rst-class:: classref-themeproperty
  185. :ref:`Texture2D<class_Texture2D>` **updown_disabled** :ref:`🔗<class_EditorSpinSlider_theme_icon_updown_disabled>`
  186. Single texture representing both the up and down buttons, when the control is readonly or disabled.
  187. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  188. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  189. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  190. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  191. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  192. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  193. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  194. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  195. .. |void| replace:: :abbr:`void (No return value.)`