Files
godot-docs/classes/class_editorspinslider.rst
2025-06-07 03:33:02 +00:00

278 lines
12 KiB
ReStructuredText

: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/EditorSpinSlider.xml.
.. _class_EditorSpinSlider:
EditorSpinSlider
================
**Inherits:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Godot editor's control for editing numeric values.
.. rst-class:: classref-introduction-group
Description
-----------
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.
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.
.. rst-class:: classref-reftable-group
Properties
----------
.. table::
:widths: auto
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`editing_integer<class_EditorSpinSlider_property_editing_integer>` | ``false`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`flat<class_EditorSpinSlider_property_flat>` | ``false`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`hide_slider<class_EditorSpinSlider_property_hide_slider>` | ``false`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`label<class_EditorSpinSlider_property_label>` | ``""`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`read_only<class_EditorSpinSlider_property_read_only>` | ``false`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| |bitfield|\[:ref:`SizeFlags<enum_Control_SizeFlags>`\] | size_flags_vertical | ``1`` (overrides :ref:`Control<class_Control_property_size_flags_vertical>`) |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`float<class_float>` | step | ``1.0`` (overrides :ref:`Range<class_Range_property_step>`) |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`suffix<class_EditorSpinSlider_property_suffix>` | ``""`` |
+--------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
.. rst-class:: classref-reftable-group
Theme Properties
----------------
.. table::
:widths: auto
+-----------------------------------+---------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`updown<class_EditorSpinSlider_theme_icon_updown>` |
+-----------------------------------+---------------------------------------------------------------------------+
| :ref:`Texture2D<class_Texture2D>` | :ref:`updown_disabled<class_EditorSpinSlider_theme_icon_updown_disabled>` |
+-----------------------------------+---------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Signals
-------
.. _class_EditorSpinSlider_signal_grabbed:
.. rst-class:: classref-signal
**grabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_grabbed>`
Emitted when the spinner/slider is grabbed.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_signal_ungrabbed:
.. rst-class:: classref-signal
**ungrabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_ungrabbed>`
Emitted when the spinner/slider is ungrabbed.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_signal_updown_pressed:
.. rst-class:: classref-signal
**updown_pressed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_updown_pressed>`
Emitted when the updown button is pressed.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_signal_value_focus_entered:
.. rst-class:: classref-signal
**value_focus_entered**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_value_focus_entered>`
Emitted when the value form gains focus.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_signal_value_focus_exited:
.. rst-class:: classref-signal
**value_focus_exited**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_value_focus_exited>`
Emitted when the value form loses focus.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_EditorSpinSlider_property_editing_integer:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **editing_integer** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_editing_integer>`
.. rst-class:: classref-property-setget
- |void| **set_editing_integer**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_editing_integer**\ (\ )
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. The slider is only drawn for floats; integers use up-down arrows similar to :ref:`SpinBox<class_SpinBox>` instead.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_property_flat:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **flat** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_flat>`
.. rst-class:: classref-property-setget
- |void| **set_flat**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_flat**\ (\ )
If ``true``, the slider will not draw background.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_property_hide_slider:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **hide_slider** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_hide_slider>`
.. rst-class:: classref-property-setget
- |void| **set_hide_slider**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_hiding_slider**\ (\ )
If ``true``, the slider and up/down arrows are hidden.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_property_label:
.. rst-class:: classref-property
:ref:`String<class_String>` **label** = ``""`` :ref:`🔗<class_EditorSpinSlider_property_label>`
.. rst-class:: classref-property-setget
- |void| **set_label**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_label**\ (\ )
The text that displays to the left of the value.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_property_read_only:
.. rst-class:: classref-property
:ref:`bool<class_bool>` **read_only** = ``false`` :ref:`🔗<class_EditorSpinSlider_property_read_only>`
.. rst-class:: classref-property-setget
- |void| **set_read_only**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_read_only**\ (\ )
If ``true``, the slider can't be interacted with.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_property_suffix:
.. rst-class:: classref-property
:ref:`String<class_String>` **suffix** = ``""`` :ref:`🔗<class_EditorSpinSlider_property_suffix>`
.. rst-class:: classref-property-setget
- |void| **set_suffix**\ (\ value\: :ref:`String<class_String>`\ )
- :ref:`String<class_String>` **get_suffix**\ (\ )
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.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Theme Property Descriptions
---------------------------
.. _class_EditorSpinSlider_theme_icon_updown:
.. rst-class:: classref-themeproperty
:ref:`Texture2D<class_Texture2D>` **updown** :ref:`🔗<class_EditorSpinSlider_theme_icon_updown>`
Single texture representing both the up and down buttons.
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_theme_icon_updown_disabled:
.. rst-class:: classref-themeproperty
:ref:`Texture2D<class_Texture2D>` **updown_disabled** :ref:`🔗<class_EditorSpinSlider_theme_icon_updown_disabled>`
Single texture representing both the up and down buttons, when the control is readonly or disabled.
.. |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.)`