: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/EditorInspectorPlugin.xml. .. _class_EditorInspectorPlugin: EditorInspectorPlugin ===================== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Plugin for adding custom property editors on the inspector. .. rst-class:: classref-introduction-group Description ----------- **EditorInspectorPlugin** allows adding custom property editors to :ref:`EditorInspector`. When an object is edited, the :ref:`_can_handle()` function is called and must return ``true`` if the object type is supported. If supported, the function :ref:`_parse_begin()` will be called, allowing to place custom controls at the beginning of the class. Subsequently, the :ref:`_parse_category()` and :ref:`_parse_property()` are called for every category and property. They offer the ability to add custom controls to the inspector too. Finally, :ref:`_parse_end()` will be called. On each of these calls, the "add" functions can be called. To use **EditorInspectorPlugin**, register it using the :ref:`EditorPlugin.add_inspector_plugin()` method first. .. rst-class:: classref-introduction-group Tutorials --------- - :doc:`Inspector plugins <../tutorials/plugins/editor/inspector_plugins>` .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_can_handle`\ (\ object\: :ref:`Object`\ ) |virtual| |const| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_parse_begin`\ (\ object\: :ref:`Object`\ ) |virtual| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_parse_category`\ (\ object\: :ref:`Object`, category\: :ref:`String`\ ) |virtual| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_parse_end`\ (\ object\: :ref:`Object`\ ) |virtual| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`_parse_group`\ (\ object\: :ref:`Object`, group\: :ref:`String`\ ) |virtual| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`_parse_property`\ (\ object\: :ref:`Object`, type\: :ref:`Variant.Type`, name\: :ref:`String`, hint_type\: :ref:`PropertyHint`, hint_string\: :ref:`String`, usage_flags\: |bitfield|\[:ref:`PropertyUsageFlags`\], wide\: :ref:`bool`\ ) |virtual| | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_custom_control`\ (\ control\: :ref:`Control`\ ) | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_property_editor`\ (\ property\: :ref:`String`, editor\: :ref:`Control`, add_to_end\: :ref:`bool` = false, label\: :ref:`String` = ""\ ) | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`add_property_editor_for_multiple_properties`\ (\ label\: :ref:`String`, properties\: :ref:`PackedStringArray`, editor\: :ref:`Control`\ ) | +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_EditorInspectorPlugin_private_method__can_handle: .. rst-class:: classref-method :ref:`bool` **_can_handle**\ (\ object\: :ref:`Object`\ ) |virtual| |const| :ref:`🔗` Returns ``true`` if this object can be handled by this plugin. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_private_method__parse_begin: .. rst-class:: classref-method |void| **_parse_begin**\ (\ object\: :ref:`Object`\ ) |virtual| :ref:`🔗` Called to allow adding controls at the beginning of the property list for ``object``. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_private_method__parse_category: .. rst-class:: classref-method |void| **_parse_category**\ (\ object\: :ref:`Object`, category\: :ref:`String`\ ) |virtual| :ref:`🔗` Called to allow adding controls at the beginning of a category in the property list for ``object``. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_private_method__parse_end: .. rst-class:: classref-method |void| **_parse_end**\ (\ object\: :ref:`Object`\ ) |virtual| :ref:`🔗` Called to allow adding controls at the end of the property list for ``object``. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_private_method__parse_group: .. rst-class:: classref-method |void| **_parse_group**\ (\ object\: :ref:`Object`, group\: :ref:`String`\ ) |virtual| :ref:`🔗` Called to allow adding controls at the beginning of a group or a sub-group in the property list for ``object``. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_private_method__parse_property: .. rst-class:: classref-method :ref:`bool` **_parse_property**\ (\ object\: :ref:`Object`, type\: :ref:`Variant.Type`, name\: :ref:`String`, hint_type\: :ref:`PropertyHint`, hint_string\: :ref:`String`, usage_flags\: |bitfield|\[:ref:`PropertyUsageFlags`\], wide\: :ref:`bool`\ ) |virtual| :ref:`🔗` Called to allow adding property-specific editors to the property list for ``object``. The added editor control must extend :ref:`EditorProperty`. Returning ``true`` removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_method_add_custom_control: .. rst-class:: classref-method |void| **add_custom_control**\ (\ control\: :ref:`Control`\ ) :ref:`🔗` Adds a custom control, which is not necessarily a property editor. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_method_add_property_editor: .. rst-class:: classref-method |void| **add_property_editor**\ (\ property\: :ref:`String`, editor\: :ref:`Control`, add_to_end\: :ref:`bool` = false, label\: :ref:`String` = ""\ ) :ref:`🔗` Adds a property editor for an individual property. The ``editor`` control must extend :ref:`EditorProperty`. There can be multiple property editors for a property. If ``add_to_end`` is ``true``, this newly added editor will be displayed after all the other editors of the property whose ``add_to_end`` is ``false``. For example, the editor uses this parameter to add an "Edit Region" button for :ref:`Sprite2D.region_rect` below the regular :ref:`Rect2` editor. \ ``label`` can be used to choose a custom label for the property editor in the inspector. If left empty, the label is computed from the name of the property instead. .. rst-class:: classref-item-separator ---- .. _class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties: .. rst-class:: classref-method |void| **add_property_editor_for_multiple_properties**\ (\ label\: :ref:`String`, properties\: :ref:`PackedStringArray`, editor\: :ref:`Control`\ ) :ref:`🔗` Adds an editor that allows modifying multiple properties. The ``editor`` control must extend :ref:`EditorProperty`. .. |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.)`