class_editorinspectorplugin.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/EditorInspectorPlugin.xml.
  6. .. _class_EditorInspectorPlugin:
  7. EditorInspectorPlugin
  8. =====================
  9. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. Plugin for adding custom property editors on inspector.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **EditorInspectorPlugin** allows adding custom property editors to :ref:`EditorInspector<class_EditorInspector>`.
  15. 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.
  16. 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.
  17. 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.
  18. Finally, :ref:`parse_end<class_EditorInspectorPlugin_method_parse_end>` will be called.
  19. On each of these calls, the "add" functions can be called.
  20. To use **EditorInspectorPlugin**, register it using the :ref:`EditorPlugin.add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>` method first.
  21. .. rst-class:: classref-introduction-group
  22. Tutorials
  23. ---------
  24. - :doc:`Inspector plugins <../tutorials/plugins/editor/inspector_plugins>`
  25. .. rst-class:: classref-reftable-group
  26. Methods
  27. -------
  28. .. table::
  29. :widths: auto
  30. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_custom_control<class_EditorInspectorPlugin_method_add_custom_control>` **(** :ref:`Control<class_Control>` control **)** |
  32. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`add_property_editor<class_EditorInspectorPlugin_method_add_property_editor>` **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor **)** |
  34. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`add_property_editor_for_multiple_properties<class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties>` **(** :ref:`String<class_String>` label, :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Control<class_Control>` editor **)** |
  36. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`can_handle<class_EditorInspectorPlugin_method_can_handle>` **(** :ref:`Object<class_Object>` object **)** |virtual| |
  38. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`parse_begin<class_EditorInspectorPlugin_method_parse_begin>` **(** :ref:`Object<class_Object>` object **)** |virtual| |
  40. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`parse_category<class_EditorInspectorPlugin_method_parse_category>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** |virtual| |
  42. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`parse_end<class_EditorInspectorPlugin_method_parse_end>` **(** **)** |virtual| |
  44. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :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>` path, :ref:`int<class_int>` hint, :ref:`String<class_String>` hint_text, :ref:`int<class_int>` usage **)** |virtual| |
  46. +-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. .. rst-class:: classref-section-separator
  48. ----
  49. .. rst-class:: classref-descriptions-group
  50. Method Descriptions
  51. -------------------
  52. .. _class_EditorInspectorPlugin_method_add_custom_control:
  53. .. rst-class:: classref-method
  54. void **add_custom_control** **(** :ref:`Control<class_Control>` control **)**
  55. Adds a custom control, which is not necessarily a property editor.
  56. .. rst-class:: classref-item-separator
  57. ----
  58. .. _class_EditorInspectorPlugin_method_add_property_editor:
  59. .. rst-class:: classref-method
  60. void **add_property_editor** **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor **)**
  61. Adds a property editor for an individual property. The ``editor`` control must extend :ref:`EditorProperty<class_EditorProperty>`.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties:
  65. .. rst-class:: classref-method
  66. void **add_property_editor_for_multiple_properties** **(** :ref:`String<class_String>` label, :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Control<class_Control>` editor **)**
  67. Adds an editor that allows modifying multiple properties. The ``editor`` control must extend :ref:`EditorProperty<class_EditorProperty>`.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_EditorInspectorPlugin_method_can_handle:
  71. .. rst-class:: classref-method
  72. :ref:`bool<class_bool>` **can_handle** **(** :ref:`Object<class_Object>` object **)** |virtual|
  73. Returns ``true`` if this object can be handled by this plugin.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_EditorInspectorPlugin_method_parse_begin:
  77. .. rst-class:: classref-method
  78. void **parse_begin** **(** :ref:`Object<class_Object>` object **)** |virtual|
  79. Called to allow adding controls at the beginning of the list.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_EditorInspectorPlugin_method_parse_category:
  83. .. rst-class:: classref-method
  84. void **parse_category** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** |virtual|
  85. Called to allow adding controls at the beginning of the category.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_EditorInspectorPlugin_method_parse_end:
  89. .. rst-class:: classref-method
  90. void **parse_end** **(** **)** |virtual|
  91. Called to allow adding controls at the end of the list.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_EditorInspectorPlugin_method_parse_property:
  95. .. rst-class:: classref-method
  96. :ref:`bool<class_bool>` **parse_property** **(** :ref:`Object<class_Object>` object, :ref:`int<class_int>` type, :ref:`String<class_String>` path, :ref:`int<class_int>` hint, :ref:`String<class_String>` hint_text, :ref:`int<class_int>` usage **)** |virtual|
  97. Called to allow adding property specific editors to the inspector. Usually these inherit :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.
  98. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  99. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  100. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  101. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`