: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/EditorProperty.xml. .. _class_EditorProperty: EditorProperty ============== **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` Custom control for editing properties that can be added to the :ref:`EditorInspector`. .. rst-class:: classref-introduction-group Description ----------- A custom control for editing properties that can be added to the :ref:`EditorInspector`. It is added via :ref:`EditorInspectorPlugin`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`checkable` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`checked` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`deletable` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`draw_background` | ``true`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`draw_label` | ``true`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`draw_warning` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`FocusMode` | focus_mode | ``3`` (overrides :ref:`Control`) | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`keying` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`String` | :ref:`label` | ``""`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`float` | :ref:`name_split_ratio` | ``0.5`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`read_only` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`selectable` | ``true`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ | :ref:`bool` | :ref:`use_folding` | ``false`` | +------------------------------------------+-------------------------------------------------------------------------+---------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_set_read_only`\ (\ read_only\: :ref:`bool`\ ) |virtual| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_update_property`\ (\ ) |virtual| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_focusable`\ (\ control\: :ref:`Control`\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`deselect`\ (\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`emit_changed`\ (\ property\: :ref:`StringName`, value\: :ref:`Variant`, field\: :ref:`StringName` = &"", changing\: :ref:`bool` = false\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Object` | :ref:`get_edited_object`\ (\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`StringName` | :ref:`get_edited_property`\ (\ ) |const| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_selected`\ (\ ) |const| | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`select`\ (\ focusable\: :ref:`int` = -1\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_bottom_editor`\ (\ editor\: :ref:`Control`\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_label_reference`\ (\ control\: :ref:`Control`\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`set_object_and_property`\ (\ object\: :ref:`Object`, property\: :ref:`StringName`\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`update_property`\ (\ ) | +-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_EditorProperty_signal_multiple_properties_changed: .. rst-class:: classref-signal **multiple_properties_changed**\ (\ properties\: :ref:`PackedStringArray`, value\: :ref:`Array`\ ) :ref:`🔗` Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin._parse_property()`. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_object_id_selected: .. rst-class:: classref-signal **object_id_selected**\ (\ property\: :ref:`StringName`, id\: :ref:`int`\ ) :ref:`🔗` Used by sub-inspectors. Emit it if what was selected was an Object ID. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_can_revert_changed: .. rst-class:: classref-signal **property_can_revert_changed**\ (\ property\: :ref:`StringName`, can_revert\: :ref:`bool`\ ) :ref:`🔗` Emitted when the revertability (i.e., whether it has a non-default value and thus is displayed with a revert icon) of a property has changed. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_changed: .. rst-class:: classref-signal **property_changed**\ (\ property\: :ref:`StringName`, value\: :ref:`Variant`, field\: :ref:`StringName`, changing\: :ref:`bool`\ ) :ref:`🔗` Do not emit this manually, use the :ref:`emit_changed()` method instead. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_checked: .. rst-class:: classref-signal **property_checked**\ (\ property\: :ref:`StringName`, checked\: :ref:`bool`\ ) :ref:`🔗` Emitted when a property was checked. Used internally. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_deleted: .. rst-class:: classref-signal **property_deleted**\ (\ property\: :ref:`StringName`\ ) :ref:`🔗` Emitted when a property was deleted. Used internally. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_favorited: .. rst-class:: classref-signal **property_favorited**\ (\ property\: :ref:`StringName`, favorited\: :ref:`bool`\ ) :ref:`🔗` 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`\ ) :ref:`🔗` Emit it if you want to add this value as an animation key (check for keying being enabled first). .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_keyed_with_value: .. rst-class:: classref-signal **property_keyed_with_value**\ (\ property\: :ref:`StringName`, value\: :ref:`Variant`\ ) :ref:`🔗` Emit it if you want to key a property with a single value. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_property_overridden: .. rst-class:: classref-signal **property_overridden**\ (\ ) :ref:`🔗` 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`, pinned\: :ref:`bool`\ ) :ref:`🔗` Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value. The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instantiation chain, a script or a builtin class. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_resource_selected: .. rst-class:: classref-signal **resource_selected**\ (\ path\: :ref:`String`, resource\: :ref:`Resource`\ ) :ref:`🔗` If you want a sub-resource to be edited, emit this signal with the resource. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_signal_selected: .. rst-class:: classref-signal **selected**\ (\ path\: :ref:`String`, focusable_idx\: :ref:`int`\ ) :ref:`🔗` Emitted when selected. Used internally. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_EditorProperty_property_checkable: .. rst-class:: classref-property :ref:`bool` **checkable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_checkable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_checkable**\ (\ ) Used by the inspector, set to ``true`` when the property is checkable. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_checked: .. rst-class:: classref-property :ref:`bool` **checked** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_checked**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_checked**\ (\ ) Used by the inspector, set to ``true`` when the property is checked. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_deletable: .. rst-class:: classref-property :ref:`bool` **deletable** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_deletable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_deletable**\ (\ ) Used by the inspector, set to ``true`` when the property can be deleted by the user. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_draw_background: .. rst-class:: classref-property :ref:`bool` **draw_background** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_draw_background**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_draw_background**\ (\ ) Used by the inspector, set to ``true`` when the property background is drawn. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_draw_label: .. rst-class:: classref-property :ref:`bool` **draw_label** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_draw_label**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_draw_label**\ (\ ) Used by the inspector, set to ``true`` when the property label is drawn. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_draw_warning: .. rst-class:: classref-property :ref:`bool` **draw_warning** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_draw_warning**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_draw_warning**\ (\ ) Used by the inspector, set to ``true`` when the property is drawn with the editor theme's warning color. This is used for editable children's properties. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_keying: .. rst-class:: classref-property :ref:`bool` **keying** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_keying**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_keying**\ (\ ) Used by the inspector, set to ``true`` when the property can add keys for animation. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_label: .. rst-class:: classref-property :ref:`String` **label** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_label**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_label**\ (\ ) Set this property to change the label (if you want to show one). .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_name_split_ratio: .. rst-class:: classref-property :ref:`float` **name_split_ratio** = ``0.5`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_name_split_ratio**\ (\ value\: :ref:`float`\ ) - :ref:`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` **read_only** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_read_only**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_read_only**\ (\ ) Used by the inspector, set to ``true`` when the property is read-only. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_selectable: .. rst-class:: classref-property :ref:`bool` **selectable** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_selectable**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_selectable**\ (\ ) Used by the inspector, set to ``true`` when the property is selectable. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_property_use_folding: .. rst-class:: classref-property :ref:`bool` **use_folding** = ``false`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_use_folding**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **is_using_folding**\ (\ ) Used by the inspector, set to ``true`` when the property is using folding. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_EditorProperty_private_method__set_read_only: .. rst-class:: classref-method |void| **_set_read_only**\ (\ read_only\: :ref:`bool`\ ) |virtual| :ref:`🔗` Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_private_method__update_property: .. rst-class:: classref-method |void| **_update_property**\ (\ ) |virtual| :ref:`🔗` When this virtual function is called, you must update your editor. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_add_focusable: .. rst-class:: classref-method |void| **add_focusable**\ (\ control\: :ref:`Control`\ ) :ref:`🔗` If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_deselect: .. rst-class:: classref-method |void| **deselect**\ (\ ) :ref:`🔗` Draw property as not selected. Used by the inspector. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_emit_changed: .. rst-class:: classref-method |void| **emit_changed**\ (\ property\: :ref:`StringName`, value\: :ref:`Variant`, field\: :ref:`StringName` = &"", changing\: :ref:`bool` = false\ ) :ref:`🔗` If one or several properties have changed, this must be called. ``field`` is used in case your editor can modify fields separately (as an example, Vector3.x). The ``changing`` argument avoids the editor requesting this property to be refreshed (leave as ``false`` if unsure). .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_get_edited_object: .. rst-class:: classref-method :ref:`Object` **get_edited_object**\ (\ ) :ref:`🔗` 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()` and :ref:`_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` **get_edited_property**\ (\ ) |const| :ref:`🔗` Returns the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin._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()` and :ref:`_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` **is_selected**\ (\ ) |const| :ref:`🔗` 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` = -1\ ) :ref:`🔗` Draw property as selected. Used by the inspector. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_set_bottom_editor: .. rst-class:: classref-method |void| **set_bottom_editor**\ (\ editor\: :ref:`Control`\ ) :ref:`🔗` Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child()`. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_set_label_reference: .. rst-class:: classref-method |void| **set_label_reference**\ (\ control\: :ref:`Control`\ ) :ref:`🔗` 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`, property\: :ref:`StringName`\ ) :ref:`🔗` Assigns object and property to edit. .. rst-class:: classref-item-separator ---- .. _class_EditorProperty_method_update_property: .. rst-class:: classref-method |void| **update_property**\ (\ ) :ref:`🔗` Forces a refresh of the property display. .. |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.)`