123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- :github_url: hide
- .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
- .. DO NOT EDIT THIS FILE, but the EditorProperty.xml source instead.
- .. The source is found in doc/classes or modules/<name>/doc_classes.
- .. _class_EditorProperty:
- EditorProperty
- ==============
- **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- Custom control to edit properties for adding into the inspector.
- Description
- -----------
- This control allows property editing for one or multiple properties into :ref:`EditorInspector<class_EditorInspector>`. It is added via :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>`.
- Properties
- ----------
- +-----------------------------+-----------------------------------------------------------+-----------+
- | :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:`draw_red<class_EditorProperty_property_draw_red>` | ``false`` |
- +-----------------------------+-----------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`keying<class_EditorProperty_property_keying>` | ``false`` |
- +-----------------------------+-----------------------------------------------------------+-----------+
- | :ref:`String<class_String>` | :ref:`label<class_EditorProperty_property_label>` | ``""`` |
- +-----------------------------+-----------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`read_only<class_EditorProperty_property_read_only>` | ``false`` |
- +-----------------------------+-----------------------------------------------------------+-----------+
- Methods
- -------
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`add_focusable<class_EditorProperty_method_add_focusable>` **(** :ref:`Control<class_Control>` control **)** |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`emit_changed<class_EditorProperty_method_emit_changed>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field="", :ref:`bool<class_bool>` changing=false **)** |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Object<class_Object>` | :ref:`get_edited_object<class_EditorProperty_method_get_edited_object>` **(** **)** |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_edited_property<class_EditorProperty_method_get_edited_property>` **(** **)** |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_tooltip_text<class_EditorProperty_method_get_tooltip_text>` **(** **)** |const| |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_bottom_editor<class_EditorProperty_method_set_bottom_editor>` **(** :ref:`Control<class_Control>` editor **)** |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`update_property<class_EditorProperty_method_update_property>` **(** **)** |virtual| |
- +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- Signals
- -------
- .. _class_EditorProperty_signal_multiple_properties_changed:
- - **multiple_properties_changed** **(** :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Array<class_Array>` value **)**
- Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin.parse_property<class_EditorInspectorPlugin_method_parse_property>`.
- ----
- .. _class_EditorProperty_signal_object_id_selected:
- - **object_id_selected** **(** :ref:`String<class_String>` property, :ref:`int<class_int>` id **)**
- Used by sub-inspectors. Emit it if what was selected was an Object ID.
- ----
- .. _class_EditorProperty_signal_property_changed:
- - **property_changed** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
- Do not emit this manually, use the :ref:`emit_changed<class_EditorProperty_method_emit_changed>` method instead.
- ----
- .. _class_EditorProperty_signal_property_checked:
- - **property_checked** **(** :ref:`String<class_String>` property, :ref:`String<class_String>` bool **)**
- Emitted when a property was checked. Used internally.
- ----
- .. _class_EditorProperty_signal_property_keyed:
- - **property_keyed** **(** :ref:`String<class_String>` property **)**
- Emit it if you want to add this value as an animation key (check for keying being enabled first).
- ----
- .. _class_EditorProperty_signal_property_keyed_with_value:
- - **property_keyed_with_value** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
- Emit it if you want to key a property with a single value.
- ----
- .. _class_EditorProperty_signal_resource_selected:
- - **resource_selected** **(** :ref:`String<class_String>` path, :ref:`Resource<class_Resource>` resource **)**
- If you want a sub-resource to be edited, emit this signal with the resource.
- ----
- .. _class_EditorProperty_signal_selected:
- - **selected** **(** :ref:`String<class_String>` path, :ref:`int<class_int>` focusable_idx **)**
- Emitted when selected. Used internally.
- Property Descriptions
- ---------------------
- .. _class_EditorProperty_property_checkable:
- - :ref:`bool<class_bool>` **checkable**
- +-----------+----------------------+
- | *Default* | ``false`` |
- +-----------+----------------------+
- | *Setter* | set_checkable(value) |
- +-----------+----------------------+
- | *Getter* | is_checkable() |
- +-----------+----------------------+
- Used by the inspector, set to ``true`` when the property is checkable.
- ----
- .. _class_EditorProperty_property_checked:
- - :ref:`bool<class_bool>` **checked**
- +-----------+--------------------+
- | *Default* | ``false`` |
- +-----------+--------------------+
- | *Setter* | set_checked(value) |
- +-----------+--------------------+
- | *Getter* | is_checked() |
- +-----------+--------------------+
- Used by the inspector, set to ``true`` when the property is checked.
- ----
- .. _class_EditorProperty_property_draw_red:
- - :ref:`bool<class_bool>` **draw_red**
- +-----------+---------------------+
- | *Default* | ``false`` |
- +-----------+---------------------+
- | *Setter* | set_draw_red(value) |
- +-----------+---------------------+
- | *Getter* | is_draw_red() |
- +-----------+---------------------+
- 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.
- ----
- .. _class_EditorProperty_property_keying:
- - :ref:`bool<class_bool>` **keying**
- +-----------+-------------------+
- | *Default* | ``false`` |
- +-----------+-------------------+
- | *Setter* | set_keying(value) |
- +-----------+-------------------+
- | *Getter* | is_keying() |
- +-----------+-------------------+
- Used by the inspector, set to ``true`` when the property can add keys for animation.
- ----
- .. _class_EditorProperty_property_label:
- - :ref:`String<class_String>` **label**
- +-----------+------------------+
- | *Default* | ``""`` |
- +-----------+------------------+
- | *Setter* | set_label(value) |
- +-----------+------------------+
- | *Getter* | get_label() |
- +-----------+------------------+
- Set this property to change the label (if you want to show one).
- ----
- .. _class_EditorProperty_property_read_only:
- - :ref:`bool<class_bool>` **read_only**
- +-----------+----------------------+
- | *Default* | ``false`` |
- +-----------+----------------------+
- | *Setter* | set_read_only(value) |
- +-----------+----------------------+
- | *Getter* | is_read_only() |
- +-----------+----------------------+
- Used by the inspector, set to ``true`` when the property is read-only.
- Method Descriptions
- -------------------
- .. _class_EditorProperty_method_add_focusable:
- - void **add_focusable** **(** :ref:`Control<class_Control>` control **)**
- 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.
- ----
- .. _class_EditorProperty_method_emit_changed:
- - void **emit_changed** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field="", :ref:`bool<class_bool>` changing=false **)**
- 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).
- ----
- .. _class_EditorProperty_method_get_edited_object:
- - :ref:`Object<class_Object>` **get_edited_object** **(** **)**
- Gets the edited object.
- ----
- .. _class_EditorProperty_method_get_edited_property:
- - :ref:`String<class_String>` **get_edited_property** **(** **)**
- Gets the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin.parse_property<class_EditorInspectorPlugin_method_parse_property>`), then this will return the property.
- ----
- .. _class_EditorProperty_method_get_tooltip_text:
- - :ref:`String<class_String>` **get_tooltip_text** **(** **)** |const|
- Must be implemented to provide a custom tooltip to the property editor.
- ----
- .. _class_EditorProperty_method_set_bottom_editor:
- - void **set_bottom_editor** **(** :ref:`Control<class_Control>` editor **)**
- Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child<class_Node_method_add_child>`.
- ----
- .. _class_EditorProperty_method_update_property:
- - void **update_property** **(** **)** |virtual|
- When this virtual function is called, you must update your editor.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |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.)`
|