mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
637 lines
31 KiB
ReStructuredText
637 lines
31 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_EditorProperty:
|
||
|
||
EditorProperty
|
||
==============
|
||
|
||
**繼承:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
用於編輯屬性的自訂控制項,可以新增到 :ref:`EditorInspector<class_EditorInspector>` 中。
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
說明
|
||
----
|
||
|
||
用於編輯屬性的自訂控制項,可以新增到 :ref:`EditorInspector<class_EditorInspector>` 中。通過 :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>` 新增。
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
屬性
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`checkable<class_EditorProperty_property_checkable>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`checked<class_EditorProperty_property_checked>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`deletable<class_EditorProperty_property_deletable>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`draw_background<class_EditorProperty_property_draw_background>` | ``true`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`draw_label<class_EditorProperty_property_draw_label>` | ``true`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`draw_warning<class_EditorProperty_property_draw_warning>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``3`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`keying<class_EditorProperty_property_keying>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`String<class_String>` | :ref:`label<class_EditorProperty_property_label>` | ``""`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`float<class_float>` | :ref:`name_split_ratio<class_EditorProperty_property_name_split_ratio>` | ``0.5`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`read_only<class_EditorProperty_property_read_only>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`selectable<class_EditorProperty_property_selectable>` | ``true`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`use_folding<class_EditorProperty_property_use_folding>` | ``false`` |
|
||
+------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
方法
|
||
----
|
||
|
||
.. table::
|
||
:widths: auto
|
||
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`_set_read_only<class_EditorProperty_private_method__set_read_only>`\ (\ read_only\: :ref:`bool<class_bool>`\ ) |virtual| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`_update_property<class_EditorProperty_private_method__update_property>`\ (\ ) |virtual| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`add_focusable<class_EditorProperty_method_add_focusable>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`deselect<class_EditorProperty_method_deselect>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`emit_changed<class_EditorProperty_method_emit_changed>`\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`, field\: :ref:`StringName<class_StringName>` = &"", changing\: :ref:`bool<class_bool>` = false\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`Object<class_Object>` | :ref:`get_edited_object<class_EditorProperty_method_get_edited_object>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`StringName<class_StringName>` | :ref:`get_edited_property<class_EditorProperty_method_get_edited_property>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| :ref:`bool<class_bool>` | :ref:`is_selected<class_EditorProperty_method_is_selected>`\ (\ ) |const| |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`select<class_EditorProperty_method_select>`\ (\ focusable\: :ref:`int<class_int>` = -1\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_bottom_editor<class_EditorProperty_method_set_bottom_editor>`\ (\ editor\: :ref:`Control<class_Control>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_label_reference<class_EditorProperty_method_set_label_reference>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`set_object_and_property<class_EditorProperty_method_set_object_and_property>`\ (\ object\: :ref:`Object<class_Object>`, property\: :ref:`StringName<class_StringName>`\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
| |void| | :ref:`update_property<class_EditorProperty_method_update_property>`\ (\ ) |
|
||
+-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
訊號
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_multiple_properties_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**multiple_properties_changed**\ (\ properties\: :ref:`PackedStringArray<class_PackedStringArray>`, value\: :ref:`Array<class_Array>`\ ) :ref:`🔗<class_EditorProperty_signal_multiple_properties_changed>`
|
||
|
||
如果想要同時修改多個屬性,請發出它。如果屬性是通過 :ref:`EditorInspectorPlugin._parse_property()<class_EditorInspectorPlugin_private_method__parse_property>` 新增的,請勿使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_object_id_selected:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**object_id_selected**\ (\ property\: :ref:`StringName<class_StringName>`, id\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorProperty_signal_object_id_selected>`
|
||
|
||
子屬性檢視器會使用。如果選擇的是物件 ID,則觸發。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_can_revert_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_can_revert_changed**\ (\ property\: :ref:`StringName<class_StringName>`, can_revert\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorProperty_signal_property_can_revert_changed>`
|
||
|
||
當屬性的可恢復性(即,它是否具有非預設值並因此顯示為帶有恢復圖示)發生變化時發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_changed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_changed**\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`, field\: :ref:`StringName<class_StringName>`, changing\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorProperty_signal_property_changed>`
|
||
|
||
不要手動觸發,使用 :ref:`emit_changed()<class_EditorProperty_method_emit_changed>` 方法代替。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_checked:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_checked**\ (\ property\: :ref:`StringName<class_StringName>`, checked\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorProperty_signal_property_checked>`
|
||
|
||
勾選某個屬性時發出。內部使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_deleted:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_deleted**\ (\ property\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EditorProperty_signal_property_deleted>`
|
||
|
||
刪除某個屬性時發出。內部使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_favorited:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_favorited**\ (\ property\: :ref:`StringName<class_StringName>`, favorited\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorProperty_signal_property_favorited>`
|
||
|
||
Emit it if you want to mark a property as favorited, making it appear at the top of the inspector.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_keyed:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_keyed**\ (\ property\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EditorProperty_signal_property_keyed>`
|
||
|
||
如果你想將此值新增這個值為動畫鍵,請觸發它(首先檢查是否啟用了鍵控)。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_keyed_with_value:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_keyed_with_value**\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_EditorProperty_signal_property_keyed_with_value>`
|
||
|
||
如果你想用一個單一的值來鍵入一個屬性,請觸發它。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_overridden:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_overridden**\ (\ ) :ref:`🔗<class_EditorProperty_signal_property_overridden>`
|
||
|
||
Emitted when a setting override for the current project is requested.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_property_pinned:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**property_pinned**\ (\ property\: :ref:`StringName<class_StringName>`, pinned\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorProperty_signal_property_pinned>`
|
||
|
||
如果想要對某個屬性進行標記(或者取消標記),讓它無論是否與預設值相等都進行保存,請發出它。
|
||
|
||
預設值指節點剛剛產生實體後屬性的取值,可以來自繼承/產生實體鏈上的祖先場景、腳本或內建類。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_resource_selected:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**resource_selected**\ (\ path\: :ref:`String<class_String>`, resource\: :ref:`Resource<class_Resource>`\ ) :ref:`🔗<class_EditorProperty_signal_resource_selected>`
|
||
|
||
如果你想編輯一個子資源,請將此訊號與資源一起發出。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_signal_selected:
|
||
|
||
.. rst-class:: classref-signal
|
||
|
||
**selected**\ (\ path\: :ref:`String<class_String>`, focusable_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_EditorProperty_signal_selected>`
|
||
|
||
選擇時觸發。內部使用。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
屬性說明
|
||
--------
|
||
|
||
.. _class_EditorProperty_property_checkable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **checkable** = ``false`` :ref:`🔗<class_EditorProperty_property_checkable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_checkable**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_checkable**\ (\ )
|
||
|
||
用於屬性檢視器,該屬性可勾選時設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_checked:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **checked** = ``false`` :ref:`🔗<class_EditorProperty_property_checked>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_checked**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_checked**\ (\ )
|
||
|
||
用於屬性檢視器,該屬性已勾選時設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_deletable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **deletable** = ``false`` :ref:`🔗<class_EditorProperty_property_deletable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_deletable**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_deletable**\ (\ )
|
||
|
||
用於屬性檢視器,該屬性可以被使用者刪除時設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_draw_background:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **draw_background** = ``true`` :ref:`🔗<class_EditorProperty_property_draw_background>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_draw_background**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_draw_background**\ (\ )
|
||
|
||
由屬性檢視器使用,當屬性背景被繪製時,會設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_draw_label:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **draw_label** = ``true`` :ref:`🔗<class_EditorProperty_property_draw_label>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_draw_label**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_draw_label**\ (\ )
|
||
|
||
由屬性檢視器使用,當屬性標籤被繪製時設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_draw_warning:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **draw_warning** = ``false`` :ref:`🔗<class_EditorProperty_property_draw_warning>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_draw_warning**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_draw_warning**\ (\ )
|
||
|
||
用於屬性檢視器,該屬性用編輯器主題的警告色繪製時設定為 ``true``\ 。用於可編輯子節點的屬性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_keying:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **keying** = ``false`` :ref:`🔗<class_EditorProperty_property_keying>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_keying**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_keying**\ (\ )
|
||
|
||
用於屬性檢視器,該屬性可以被新增為動畫關鍵影格時設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_label:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`String<class_String>` **label** = ``""`` :ref:`🔗<class_EditorProperty_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_EditorProperty_property_name_split_ratio:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **name_split_ratio** = ``0.5`` :ref:`🔗<class_EditorProperty_property_name_split_ratio>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_name_split_ratio**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_name_split_ratio**\ (\ )
|
||
|
||
Space distribution ratio between the label and the editing field.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_read_only:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **read_only** = ``false`` :ref:`🔗<class_EditorProperty_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_EditorProperty_property_selectable:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **selectable** = ``true`` :ref:`🔗<class_EditorProperty_property_selectable>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_selectable**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_selectable**\ (\ )
|
||
|
||
由屬性檢視器使用,當屬性可選取時設為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_property_use_folding:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **use_folding** = ``false`` :ref:`🔗<class_EditorProperty_property_use_folding>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_use_folding**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **is_using_folding**\ (\ )
|
||
|
||
由屬性檢視器使用,當屬性使用摺疊功能時,設定為 ``true``\ 。
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
方法說明
|
||
--------
|
||
|
||
.. _class_EditorProperty_private_method__set_read_only:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **_set_read_only**\ (\ read_only\: :ref:`bool<class_bool>`\ ) |virtual| :ref:`🔗<class_EditorProperty_private_method__set_read_only>`
|
||
|
||
當屬性的唯讀狀態被改變時被呼叫。它可用於將自訂控制項改變為唯讀或可修改的狀態。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_private_method__update_property:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **_update_property**\ (\ ) |virtual| :ref:`🔗<class_EditorProperty_private_method__update_property>`
|
||
|
||
當這個虛函式被呼叫時,你必須更新你的編輯器。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_add_focusable:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **add_focusable**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorProperty_method_add_focusable>`
|
||
|
||
如果任何新增的 Control 可以取得鍵盤焦點,請在此新增。這可確保如果屬性檢視器被重新整理,焦點將會被還原。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_deselect:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **deselect**\ (\ ) :ref:`🔗<class_EditorProperty_method_deselect>`
|
||
|
||
將屬性繪製為未選取狀態。由屬性檢視器使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_emit_changed:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **emit_changed**\ (\ property\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`, field\: :ref:`StringName<class_StringName>` = &"", changing\: :ref:`bool<class_bool>` = false\ ) :ref:`🔗<class_EditorProperty_method_emit_changed>`
|
||
|
||
如果一個或幾個屬性發生了變化,必然會呼叫這個函式。\ ``field`` 用於你的編輯器可以單獨修改欄位的情況(例如,Vector3.x)。\ ``changing`` 參數可以避免編輯器請求更新該屬性(如果不確定,請保留為 ``false``\ )。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_get_edited_object:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`Object<class_Object>` **get_edited_object**\ (\ ) :ref:`🔗<class_EditorProperty_method_get_edited_object>`
|
||
|
||
Returns the edited object.
|
||
|
||
\ **Note:** This method could return ``null`` if the editor has not yet been associated with a property. However, in :ref:`_update_property()<class_EditorProperty_private_method__update_property>` and :ref:`_set_read_only()<class_EditorProperty_private_method__set_read_only>`, this value is *guaranteed* to be non-``null``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_get_edited_property:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`StringName<class_StringName>` **get_edited_property**\ (\ ) |const| :ref:`🔗<class_EditorProperty_method_get_edited_property>`
|
||
|
||
Returns the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin._parse_property()<class_EditorInspectorPlugin_private_method__parse_property>`), then this will return the property.
|
||
|
||
\ **Note:** This method could return ``null`` if the editor has not yet been associated with a property. However, in :ref:`_update_property()<class_EditorProperty_private_method__update_property>` and :ref:`_set_read_only()<class_EditorProperty_private_method__set_read_only>`, this value is *guaranteed* to be non-``null``.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_is_selected:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`bool<class_bool>` **is_selected**\ (\ ) |const| :ref:`🔗<class_EditorProperty_method_is_selected>`
|
||
|
||
Returns ``true`` if property is drawn as selected. Used by the inspector.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_select:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **select**\ (\ focusable\: :ref:`int<class_int>` = -1\ ) :ref:`🔗<class_EditorProperty_method_select>`
|
||
|
||
將屬性以選取狀態繪製。由屬性檢視器使用。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_set_bottom_editor:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_bottom_editor**\ (\ editor\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorProperty_method_set_bottom_editor>`
|
||
|
||
將 ``editor`` 控制項放在屬性標籤的下方。該控制項必須事先用 :ref:`Node.add_child()<class_Node_method_add_child>` 新增。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_set_label_reference:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_label_reference**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorProperty_method_set_label_reference>`
|
||
|
||
Used by the inspector, set to a control that will be used as a reference to calculate the size of the label.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_set_object_and_property:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **set_object_and_property**\ (\ object\: :ref:`Object<class_Object>`, property\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_EditorProperty_method_set_object_and_property>`
|
||
|
||
Assigns object and property to edit.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_update_property:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **update_property**\ (\ ) :ref:`🔗<class_EditorProperty_method_update_property>`
|
||
|
||
Forces a refresh of the property display.
|
||
|
||
.. |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 (無回傳值。)`
|