2
0

class_editorinspector.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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/EditorInspector.xml.
  6. .. _class_EditorInspector:
  7. EditorInspector
  8. ===============
  9. **Inherits:** :ref:`ScrollContainer<class_ScrollContainer>` **<** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A control used to edit properties of an object.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the **EditorInspector** used in the editor's Inspector dock, use :ref:`EditorInterface.get_inspector<class_EditorInterface_method_get_inspector>`.
  15. \ **EditorInspector** will show properties in the same order as the array returned by :ref:`Object.get_property_list<class_Object_method_get_property_list>`.
  16. If a property's name is path-like (i.e. if it contains forward slashes), **EditorInspector** will create nested sections for "directories" along the path. For example, if a property is named ``highlighting/gdscript/node_path_color``, it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section.
  17. If a property has :ref:`@GlobalScope.PROPERTY_USAGE_GROUP<class_@GlobalScope_constant_PROPERTY_USAGE_GROUP>` usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. **EditorInspector** will create a top-level section for each group. For example, if a property with group usage is named ``Collide With`` and its hint string is ``collide_with_``, a subsequent ``collide_with_area`` property will be shown as "Area" inside the "Collide With" section.
  18. \ **Note:** Unlike sections created from path-like property names, **EditorInspector** won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names.
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  24. +-------------------------+---------------------------+--------------------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | scroll_horizontal_enabled | ``false`` (overrides :ref:`ScrollContainer<class_ScrollContainer_property_scroll_horizontal_enabled>`) |
  26. +-------------------------+---------------------------+--------------------------------------------------------------------------------------------------------+
  27. .. rst-class:: classref-reftable-group
  28. Methods
  29. -------
  30. .. table::
  31. :widths: auto
  32. +-----------------------------+--------------------------------------------------------------------------------------+
  33. | :ref:`Object<class_Object>` | :ref:`get_edited_object<class_EditorInspector_method_get_edited_object>` **(** **)** |
  34. +-----------------------------+--------------------------------------------------------------------------------------+
  35. | void | :ref:`refresh<class_EditorInspector_method_refresh>` **(** **)** |
  36. +-----------------------------+--------------------------------------------------------------------------------------+
  37. .. rst-class:: classref-section-separator
  38. ----
  39. .. rst-class:: classref-descriptions-group
  40. Signals
  41. -------
  42. .. _class_EditorInspector_signal_object_id_selected:
  43. .. rst-class:: classref-signal
  44. **object_id_selected** **(** :ref:`int<class_int>` id **)**
  45. Emitted when the Edit button of an :ref:`Object<class_Object>` has been pressed in the inspector. This is mainly used in the remote scene tree inspector.
  46. .. rst-class:: classref-item-separator
  47. ----
  48. .. _class_EditorInspector_signal_property_edited:
  49. .. rst-class:: classref-signal
  50. **property_edited** **(** :ref:`String<class_String>` property **)**
  51. Emitted when a property is edited in the inspector.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_EditorInspector_signal_property_keyed:
  55. .. rst-class:: classref-signal
  56. **property_keyed** **(** :ref:`String<class_String>` property **)**
  57. Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled.
  58. .. rst-class:: classref-item-separator
  59. ----
  60. .. _class_EditorInspector_signal_property_selected:
  61. .. rst-class:: classref-signal
  62. **property_selected** **(** :ref:`String<class_String>` property **)**
  63. Emitted when a property is selected in the inspector.
  64. .. rst-class:: classref-item-separator
  65. ----
  66. .. _class_EditorInspector_signal_property_toggled:
  67. .. rst-class:: classref-signal
  68. **property_toggled** **(** :ref:`String<class_String>` property, :ref:`bool<class_bool>` checked **)**
  69. Emitted when a boolean property is toggled in the inspector.
  70. \ **Note:** This signal is never emitted if the internal ``autoclear`` property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_EditorInspector_signal_resource_selected:
  74. .. rst-class:: classref-signal
  75. **resource_selected** **(** :ref:`Object<class_Object>` res, :ref:`String<class_String>` prop **)**
  76. Emitted when a resource is selected in the inspector.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_EditorInspector_signal_restart_requested:
  80. .. rst-class:: classref-signal
  81. **restart_requested** **(** **)**
  82. Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings.
  83. .. rst-class:: classref-section-separator
  84. ----
  85. .. rst-class:: classref-descriptions-group
  86. Method Descriptions
  87. -------------------
  88. .. _class_EditorInspector_method_get_edited_object:
  89. .. rst-class:: classref-method
  90. :ref:`Object<class_Object>` **get_edited_object** **(** **)**
  91. Returns the object currently selected in this inspector.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_EditorInspector_method_refresh:
  95. .. rst-class:: classref-method
  96. void **refresh** **(** **)**
  97. Refreshes the inspector.
  98. \ **Note:** To save on CPU resources, calling this method will do nothing if the time specified in ``docks/property_editor/auto_refresh_interval`` editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.)
  99. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  100. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  101. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  102. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`