class_editorinspectorplugin.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorInspectorPlugin.xml.
  6. .. _class_EditorInspectorPlugin:
  7. EditorInspectorPlugin
  8. =====================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Plugin for adding custom property editors on the inspector.
  11. Description
  12. -----------
  13. ``EditorInspectorPlugin`` allows adding custom property editors to :ref:`EditorInspector<class_EditorInspector>`.
  14. When an object is edited, the :ref:`_can_handle<class_EditorInspectorPlugin_method__can_handle>` function is called and must return ``true`` if the object type is supported.
  15. If supported, the function :ref:`_parse_begin<class_EditorInspectorPlugin_method__parse_begin>` will be called, allowing to place custom controls at the beginning of the class.
  16. Subsequently, the :ref:`_parse_category<class_EditorInspectorPlugin_method__parse_category>` and :ref:`_parse_property<class_EditorInspectorPlugin_method__parse_property>` are called for every category and property. They offer the ability to add custom controls to the inspector too.
  17. Finally, :ref:`_parse_end<class_EditorInspectorPlugin_method__parse_end>` will be called.
  18. On each of these calls, the "add" functions can be called.
  19. To use ``EditorInspectorPlugin``, register it using the :ref:`EditorPlugin.add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` method first.
  20. Tutorials
  21. ---------
  22. - :doc:`Inspector plugins <../tutorials/plugins/editor/inspector_plugins>`
  23. Methods
  24. -------
  25. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | :ref:`_can_handle<class_EditorInspectorPlugin_method__can_handle>` **(** :ref:`Variant<class_Variant>` object **)** |virtual| |const| |
  27. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`_parse_begin<class_EditorInspectorPlugin_method__parse_begin>` **(** :ref:`Object<class_Object>` object **)** |virtual| |
  29. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`_parse_category<class_EditorInspectorPlugin_method__parse_category>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** |virtual| |
  31. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`_parse_end<class_EditorInspectorPlugin_method__parse_end>` **(** :ref:`Object<class_Object>` object **)** |virtual| |
  33. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`_parse_group<class_EditorInspectorPlugin_method__parse_group>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` group **)** |virtual| |
  35. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`_parse_property<class_EditorInspectorPlugin_method__parse_property>` **(** :ref:`Object<class_Object>` object, :ref:`int<class_int>` type, :ref:`String<class_String>` name, :ref:`int<class_int>` hint_type, :ref:`String<class_String>` hint_string, :ref:`int<class_int>` usage_flags, :ref:`bool<class_bool>` wide **)** |virtual| |
  37. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`add_custom_control<class_EditorInspectorPlugin_method_add_custom_control>` **(** :ref:`Control<class_Control>` control **)** |
  39. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`add_property_editor<class_EditorInspectorPlugin_method_add_property_editor>` **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor, :ref:`bool<class_bool>` add_to_end=false **)** |
  41. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`add_property_editor_for_multiple_properties<class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties>` **(** :ref:`String<class_String>` label, :ref:`PackedStringArray<class_PackedStringArray>` properties, :ref:`Control<class_Control>` editor **)** |
  43. +-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. Method Descriptions
  45. -------------------
  46. .. _class_EditorInspectorPlugin_method__can_handle:
  47. - :ref:`bool<class_bool>` **_can_handle** **(** :ref:`Variant<class_Variant>` object **)** |virtual| |const|
  48. Returns ``true`` if this object can be handled by this plugin.
  49. ----
  50. .. _class_EditorInspectorPlugin_method__parse_begin:
  51. - void **_parse_begin** **(** :ref:`Object<class_Object>` object **)** |virtual|
  52. Called to allow adding controls at the beginning of the property list for ``object``.
  53. ----
  54. .. _class_EditorInspectorPlugin_method__parse_category:
  55. - void **_parse_category** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** |virtual|
  56. Called to allow adding controls at the beginning of a category in the property list for ``object``.
  57. ----
  58. .. _class_EditorInspectorPlugin_method__parse_end:
  59. - void **_parse_end** **(** :ref:`Object<class_Object>` object **)** |virtual|
  60. Called to allow adding controls at the end of the property list for ``object``.
  61. ----
  62. .. _class_EditorInspectorPlugin_method__parse_group:
  63. - void **_parse_group** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` group **)** |virtual|
  64. Called to allow adding controls at the beginning of a group or a sub-group in the property list for ``object``.
  65. ----
  66. .. _class_EditorInspectorPlugin_method__parse_property:
  67. - :ref:`bool<class_bool>` **_parse_property** **(** :ref:`Object<class_Object>` object, :ref:`int<class_int>` type, :ref:`String<class_String>` name, :ref:`int<class_int>` hint_type, :ref:`String<class_String>` hint_string, :ref:`int<class_int>` usage_flags, :ref:`bool<class_bool>` wide **)** |virtual|
  68. Called to allow adding property-specific editors to the property list for ``object``. The added editor control must extend :ref:`EditorProperty<class_EditorProperty>`. Returning ``true`` removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
  69. ----
  70. .. _class_EditorInspectorPlugin_method_add_custom_control:
  71. - void **add_custom_control** **(** :ref:`Control<class_Control>` control **)**
  72. Adds a custom control, which is not necessarily a property editor.
  73. ----
  74. .. _class_EditorInspectorPlugin_method_add_property_editor:
  75. - void **add_property_editor** **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor, :ref:`bool<class_bool>` add_to_end=false **)**
  76. Adds a property editor for an individual property. The ``editor`` control must extend :ref:`EditorProperty<class_EditorProperty>`.
  77. ----
  78. .. _class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties:
  79. - void **add_property_editor_for_multiple_properties** **(** :ref:`String<class_String>` label, :ref:`PackedStringArray<class_PackedStringArray>` properties, :ref:`Control<class_Control>` editor **)**
  80. Adds an editor that allows modifying multiple properties. The ``editor`` control must extend :ref:`EditorProperty<class_EditorProperty>`.
  81. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  82. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  83. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  84. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  85. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  86. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`