class_editorinspectorplugin.rst 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the EditorInspectorPlugin.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorInspectorPlugin:
  6. EditorInspectorPlugin
  7. =====================
  8. **Inherits:** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Plugin for adding custom property editors on inspector.
  13. Methods
  14. -------
  15. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`add_custom_control<class_EditorInspectorPlugin_method_add_custom_control>` **(** :ref:`Control<class_Control>` control **)** |
  17. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | void | :ref:`add_property_editor<class_EditorInspectorPlugin_method_add_property_editor>` **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor **)** |
  19. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | 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 **)** |
  21. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`can_handle<class_EditorInspectorPlugin_method_can_handle>` **(** :ref:`Object<class_Object>` object **)** virtual |
  23. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`parse_begin<class_EditorInspectorPlugin_method_parse_begin>` **(** :ref:`Object<class_Object>` object **)** virtual |
  25. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`parse_category<class_EditorInspectorPlugin_method_parse_category>` **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** virtual |
  27. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`parse_end<class_EditorInspectorPlugin_method_parse_end>` **(** **)** virtual |
  29. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :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 |
  31. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. Description
  33. -----------
  34. This plugins allows adding custom property editors to :ref:`EditorInspector<class_EditorInspector>`.
  35. Plugins are registered via :ref:`EditorPlugin.add_inspector_plugin<class_EditorPlugin_method_add_inspector_plugin>`.
  36. 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.
  37. 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.
  38. 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.
  39. Finally :ref:`parse_end<class_EditorInspectorPlugin_method_parse_end>` will be called.
  40. On each of these calls, the "add" functions can be called.
  41. Method Descriptions
  42. -------------------
  43. .. _class_EditorInspectorPlugin_method_add_custom_control:
  44. - void **add_custom_control** **(** :ref:`Control<class_Control>` control **)**
  45. Adds a custom control, not necessarily a property editor.
  46. ----
  47. .. _class_EditorInspectorPlugin_method_add_property_editor:
  48. - void **add_property_editor** **(** :ref:`String<class_String>` property, :ref:`Control<class_Control>` editor **)**
  49. Adds a property editor, this must inherit :ref:`EditorProperty<class_EditorProperty>`.
  50. ----
  51. .. _class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties:
  52. - void **add_property_editor_for_multiple_properties** **(** :ref:`String<class_String>` label, :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Control<class_Control>` editor **)**
  53. Adds an editor that allows modifying multiple properties, this must inherit :ref:`EditorProperty<class_EditorProperty>`.
  54. ----
  55. .. _class_EditorInspectorPlugin_method_can_handle:
  56. - :ref:`bool<class_bool>` **can_handle** **(** :ref:`Object<class_Object>` object **)** virtual
  57. Returns ``true`` if this object can be handled by this plugin.
  58. ----
  59. .. _class_EditorInspectorPlugin_method_parse_begin:
  60. - void **parse_begin** **(** :ref:`Object<class_Object>` object **)** virtual
  61. Called to allow adding controls at the beginning of the list.
  62. ----
  63. .. _class_EditorInspectorPlugin_method_parse_category:
  64. - void **parse_category** **(** :ref:`Object<class_Object>` object, :ref:`String<class_String>` category **)** virtual
  65. Called to allow adding controls at the beginning of the category.
  66. ----
  67. .. _class_EditorInspectorPlugin_method_parse_end:
  68. - void **parse_end** **(** **)** virtual
  69. Called to allow adding controls at the end of the list.
  70. ----
  71. .. _class_EditorInspectorPlugin_method_parse_property:
  72. - :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
  73. Called to allow adding property specific editors to the inspector. Usually these inherit :ref:`EditorProperty<class_EditorProperty>`