mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
637 lines
30 KiB
ReStructuredText
637 lines
30 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>`
|
||
|
||
请在想要将属性标记为收藏时发出,会让属性显示在检查器开头。
|
||
|
||
.. 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>`
|
||
|
||
请求对当前项目的设置进行覆盖时发出。
|
||
|
||
.. 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**\ (\ )
|
||
|
||
标签和编辑框之间的空间占比。
|
||
|
||
.. 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>`
|
||
|
||
如果添加的任何控件可以获得键盘焦点,将其添加到此处。这样可以确保在检查器被刷新时恢复焦点。
|
||
|
||
.. 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>`
|
||
|
||
返回编辑的对象。
|
||
|
||
\ **注意:**\ 如果编辑器尚未与属性关联则会返回 ``null``\ 。不过能够\ *保证*\ 在 :ref:`_update_property()<class_EditorProperty_private_method__update_property>` 和 :ref:`_set_read_only()<class_EditorProperty_private_method__set_read_only>` 中该值非 ``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>`
|
||
|
||
返回编辑的属性。如果你的编辑器适用于单个属性(通过 :ref:`EditorInspectorPlugin._parse_property()<class_EditorInspectorPlugin_private_method__parse_property>` 添加),那么就会返回该属性。
|
||
|
||
\ **注意:**\ 如果编辑器尚未与属性关联则会返回 ``null``\ 。不过能够\ *保证*\ 在 :ref:`_update_property()<class_EditorProperty_private_method__update_property>` 和 :ref:`_set_read_only()<class_EditorProperty_private_method__set_read_only>` 中该值非 ``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>`
|
||
|
||
如果属性以未选中的形式绘制,则返回 ``true``\ 。由检查器使用。
|
||
|
||
.. 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>`
|
||
|
||
由检查器使用,设为计算标签大小时用作参考的控件。
|
||
|
||
.. 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>`
|
||
|
||
分配要编辑的对象和属性。
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_EditorProperty_method_update_property:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
|void| **update_property**\ (\ ) :ref:`🔗<class_EditorProperty_method_update_property>`
|
||
|
||
强制刷新属性显示。
|
||
|
||
.. |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 (无返回值。)`
|