Files
godot-docs-l10n/classes/zh_Hant/class_editorspinslider.rst
Rémi Verschelde c3f2364c10 Sync classref with 4.6 branch
Lots of translations invalidated (fuzzied) as we just synced Weblate.
2025-12-19 16:39:51 +01:00

333 lines
14 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

:github_url: hide
.. _class_EditorSpinSlider:
EditorSpinSlider
================
**繼承:** :ref:`Range<class_Range>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
Godot 編輯器用於編輯數值的控制項。
.. rst-class:: classref-introduction-group
說明
----
這個 :ref:`Control<class_Control>` 節點用於編輯器的屬性檢視器面板中,以允許編輯數值。可與 :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` 一起使用以達到相同的效果。
如果 :ref:`Range.step<class_Range_property_step>` 值是 ``1``\ \ **EditorSpinSlider** 將會顯示向上/向下箭頭,類似於 :ref:`SpinBox<class_SpinBox>`\ 。如果 :ref:`Range.step<class_Range_property_step>` 值不是 ``1``\ ,將會顯示滑桿代替。
.. rst-class:: classref-reftable-group
屬性
----
.. table::
:widths: auto
+---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :ref:`ControlState<enum_EditorSpinSlider_ControlState>` | :ref:`control_state<class_EditorSpinSlider_property_control_state>` | ``0`` |
+---------------------------------------------------------+-------------------------------------------------------------------------+------------------------------------------------------------------------------+
| :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
主題屬性
--------
.. 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
訊號
----
.. _class_EditorSpinSlider_signal_grabbed:
.. rst-class:: classref-signal
**grabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_grabbed>`
當微調器/滑桿被抓取時發出。
.. rst-class:: classref-item-separator
----
.. _class_EditorSpinSlider_signal_ungrabbed:
.. rst-class:: classref-signal
**ungrabbed**\ (\ ) :ref:`🔗<class_EditorSpinSlider_signal_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>`
值表單獲得焦點時發出。
.. 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>`
值表單丟失焦點時發出。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
列舉
----
.. _enum_EditorSpinSlider_ControlState:
.. rst-class:: classref-enumeration
enum **ControlState**: :ref:`🔗<enum_EditorSpinSlider_ControlState>`
.. _class_EditorSpinSlider_constant_CONTROL_STATE_DEFAULT:
.. rst-class:: classref-enumeration-constant
:ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_DEFAULT** = ``0``
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``.
.. _class_EditorSpinSlider_constant_CONTROL_STATE_PREFER_SLIDER:
.. rst-class:: classref-enumeration-constant
:ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_PREFER_SLIDER** = ``1``
A slider will always be used, even if :ref:`editing_integer<class_EditorSpinSlider_property_editing_integer>` is enabled.
.. _class_EditorSpinSlider_constant_CONTROL_STATE_HIDE:
.. rst-class:: classref-enumeration-constant
:ref:`ControlState<enum_EditorSpinSlider_ControlState>` **CONTROL_STATE_HIDE** = ``2``
Neither the up-down arrows nor the slider will be shown.
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
屬性說明
--------
.. _class_EditorSpinSlider_property_control_state:
.. rst-class:: classref-property
:ref:`ControlState<enum_EditorSpinSlider_ControlState>` **control_state** = ``0`` :ref:`🔗<class_EditorSpinSlider_property_control_state>`
.. rst-class:: classref-property-setget
- |void| **set_control_state**\ (\ value\: :ref:`ControlState<enum_EditorSpinSlider_ControlState>`\ )
- :ref:`ControlState<enum_EditorSpinSlider_ControlState>` **get_control_state**\ (\ )
The state in which the control used to manipulate the value will be.
.. rst-class:: classref-item-separator
----
.. _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 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.
.. 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**\ (\ )
如果為 ``true``\ ,則滑桿不會繪製背景。
.. 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**\ (\ )
**已棄用:** Use :ref:`control_state<class_EditorSpinSlider_property_control_state>` instead.
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**\ (\ )
在值的左側顯示的文字。
.. 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**\ (\ )
如果為 ``true``\ ,則無法與滑桿互動。
.. 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**\ (\ )
在值之後顯示的後綴(以一種淡化的顏色顯示)。這通常應該是一個複數形式的詞。如果後綴太長而無法顯示,可能必須使用縮寫。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
主題屬性說明
------------
.. _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 (本方法通常需要使用者覆寫才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
.. |void| replace:: :abbr:`void (無回傳值。)`