class_editorproperty.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370
  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/EditorProperty.xml.
  6. .. _class_EditorProperty:
  7. EditorProperty
  8. ==============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Custom control to edit properties for adding into the inspector.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This control allows property editing for one or multiple properties into :ref:`EditorInspector<class_EditorInspector>`. It is added via :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-----------------------------+-----------------------------------------------------------+-----------+
  21. | :ref:`bool<class_bool>` | :ref:`checkable<class_EditorProperty_property_checkable>` | ``false`` |
  22. +-----------------------------+-----------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`checked<class_EditorProperty_property_checked>` | ``false`` |
  24. +-----------------------------+-----------------------------------------------------------+-----------+
  25. | :ref:`bool<class_bool>` | :ref:`draw_red<class_EditorProperty_property_draw_red>` | ``false`` |
  26. +-----------------------------+-----------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`keying<class_EditorProperty_property_keying>` | ``false`` |
  28. +-----------------------------+-----------------------------------------------------------+-----------+
  29. | :ref:`String<class_String>` | :ref:`label<class_EditorProperty_property_label>` | ``""`` |
  30. +-----------------------------+-----------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`read_only<class_EditorProperty_property_read_only>` | ``false`` |
  32. +-----------------------------+-----------------------------------------------------------+-----------+
  33. .. rst-class:: classref-reftable-group
  34. Methods
  35. -------
  36. .. table::
  37. :widths: auto
  38. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | void | :ref:`add_focusable<class_EditorProperty_method_add_focusable>` **(** :ref:`Control<class_Control>` control **)** |
  40. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`emit_changed<class_EditorProperty_method_emit_changed>` **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field="", :ref:`bool<class_bool>` changing=false **)** |
  42. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`Object<class_Object>` | :ref:`get_edited_object<class_EditorProperty_method_get_edited_object>` **(** **)** |
  44. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`String<class_String>` | :ref:`get_edited_property<class_EditorProperty_method_get_edited_property>` **(** **)** |
  46. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`set_bottom_editor<class_EditorProperty_method_set_bottom_editor>` **(** :ref:`Control<class_Control>` editor **)** |
  48. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`update_property<class_EditorProperty_method_update_property>` **(** **)** |virtual| |
  50. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. .. rst-class:: classref-section-separator
  52. ----
  53. .. rst-class:: classref-descriptions-group
  54. Signals
  55. -------
  56. .. _class_EditorProperty_signal_multiple_properties_changed:
  57. .. rst-class:: classref-signal
  58. **multiple_properties_changed** **(** :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Array<class_Array>` value **)**
  59. Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin.parse_property<class_EditorInspectorPlugin_method_parse_property>`.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_EditorProperty_signal_object_id_selected:
  63. .. rst-class:: classref-signal
  64. **object_id_selected** **(** :ref:`String<class_String>` property, :ref:`int<class_int>` id **)**
  65. Used by sub-inspectors. Emit it if what was selected was an Object ID.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_EditorProperty_signal_property_changed:
  69. .. rst-class:: classref-signal
  70. **property_changed** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field, :ref:`bool<class_bool>` changing **)**
  71. Do not emit this manually, use the :ref:`emit_changed<class_EditorProperty_method_emit_changed>` method instead.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_EditorProperty_signal_property_checked:
  75. .. rst-class:: classref-signal
  76. **property_checked** **(** :ref:`String<class_String>` property, :ref:`bool<class_bool>` checked **)**
  77. Emitted when a property was checked. Used internally.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_EditorProperty_signal_property_keyed:
  81. .. rst-class:: classref-signal
  82. **property_keyed** **(** :ref:`String<class_String>` property **)**
  83. Emit it if you want to add this value as an animation key (check for keying being enabled first).
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_EditorProperty_signal_property_keyed_with_value:
  87. .. rst-class:: classref-signal
  88. **property_keyed_with_value** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value **)**
  89. Emit it if you want to key a property with a single value.
  90. .. rst-class:: classref-item-separator
  91. ----
  92. .. _class_EditorProperty_signal_property_pinned:
  93. .. rst-class:: classref-signal
  94. **property_pinned** **(** :ref:`String<class_String>` property, :ref:`bool<class_bool>` pinned **)**
  95. Emit it if you want to mark (or unmark) the value of a property for being saved regardless of being equal to the default value.
  96. The default value is the one the property will get when the node is just instantiated and can come from an ancestor scene in the inheritance/instancing chain, a script or a builtin class.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_EditorProperty_signal_resource_selected:
  100. .. rst-class:: classref-signal
  101. **resource_selected** **(** :ref:`String<class_String>` path, :ref:`Resource<class_Resource>` resource **)**
  102. If you want a sub-resource to be edited, emit this signal with the resource.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_EditorProperty_signal_selected:
  106. .. rst-class:: classref-signal
  107. **selected** **(** :ref:`String<class_String>` path, :ref:`int<class_int>` focusable_idx **)**
  108. Emitted when selected. Used internally.
  109. .. rst-class:: classref-section-separator
  110. ----
  111. .. rst-class:: classref-descriptions-group
  112. Property Descriptions
  113. ---------------------
  114. .. _class_EditorProperty_property_checkable:
  115. .. rst-class:: classref-property
  116. :ref:`bool<class_bool>` **checkable** = ``false``
  117. .. rst-class:: classref-property-setget
  118. - void **set_checkable** **(** :ref:`bool<class_bool>` value **)**
  119. - :ref:`bool<class_bool>` **is_checkable** **(** **)**
  120. Used by the inspector, set to ``true`` when the property is checkable.
  121. .. rst-class:: classref-item-separator
  122. ----
  123. .. _class_EditorProperty_property_checked:
  124. .. rst-class:: classref-property
  125. :ref:`bool<class_bool>` **checked** = ``false``
  126. .. rst-class:: classref-property-setget
  127. - void **set_checked** **(** :ref:`bool<class_bool>` value **)**
  128. - :ref:`bool<class_bool>` **is_checked** **(** **)**
  129. Used by the inspector, set to ``true`` when the property is checked.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _class_EditorProperty_property_draw_red:
  133. .. rst-class:: classref-property
  134. :ref:`bool<class_bool>` **draw_red** = ``false``
  135. .. rst-class:: classref-property-setget
  136. - void **set_draw_red** **(** :ref:`bool<class_bool>` value **)**
  137. - :ref:`bool<class_bool>` **is_draw_red** **(** **)**
  138. Used by the inspector, set to ``true`` when the property is drawn with the editor theme's warning color. This is used for editable children's properties.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_EditorProperty_property_keying:
  142. .. rst-class:: classref-property
  143. :ref:`bool<class_bool>` **keying** = ``false``
  144. .. rst-class:: classref-property-setget
  145. - void **set_keying** **(** :ref:`bool<class_bool>` value **)**
  146. - :ref:`bool<class_bool>` **is_keying** **(** **)**
  147. Used by the inspector, set to ``true`` when the property can add keys for animation.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_EditorProperty_property_label:
  151. .. rst-class:: classref-property
  152. :ref:`String<class_String>` **label** = ``""``
  153. .. rst-class:: classref-property-setget
  154. - void **set_label** **(** :ref:`String<class_String>` value **)**
  155. - :ref:`String<class_String>` **get_label** **(** **)**
  156. Set this property to change the label (if you want to show one).
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_EditorProperty_property_read_only:
  160. .. rst-class:: classref-property
  161. :ref:`bool<class_bool>` **read_only** = ``false``
  162. .. rst-class:: classref-property-setget
  163. - void **set_read_only** **(** :ref:`bool<class_bool>` value **)**
  164. - :ref:`bool<class_bool>` **is_read_only** **(** **)**
  165. Used by the inspector, set to ``true`` when the property is read-only.
  166. .. rst-class:: classref-section-separator
  167. ----
  168. .. rst-class:: classref-descriptions-group
  169. Method Descriptions
  170. -------------------
  171. .. _class_EditorProperty_method_add_focusable:
  172. .. rst-class:: classref-method
  173. void **add_focusable** **(** :ref:`Control<class_Control>` control **)**
  174. If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_EditorProperty_method_emit_changed:
  178. .. rst-class:: classref-method
  179. void **emit_changed** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field="", :ref:`bool<class_bool>` changing=false **)**
  180. If one or several properties have changed, this must be called. ``field`` is used in case your editor can modify fields separately (as an example, Vector3.x). The ``changing`` argument avoids the editor requesting this property to be refreshed (leave as ``false`` if unsure).
  181. .. rst-class:: classref-item-separator
  182. ----
  183. .. _class_EditorProperty_method_get_edited_object:
  184. .. rst-class:: classref-method
  185. :ref:`Object<class_Object>` **get_edited_object** **(** **)**
  186. Gets the edited object.
  187. .. rst-class:: classref-item-separator
  188. ----
  189. .. _class_EditorProperty_method_get_edited_property:
  190. .. rst-class:: classref-method
  191. :ref:`String<class_String>` **get_edited_property** **(** **)**
  192. Gets the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin.parse_property<class_EditorInspectorPlugin_method_parse_property>`), then this will return the property.
  193. .. rst-class:: classref-item-separator
  194. ----
  195. .. _class_EditorProperty_method_set_bottom_editor:
  196. .. rst-class:: classref-method
  197. void **set_bottom_editor** **(** :ref:`Control<class_Control>` editor **)**
  198. Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child<class_Node_method_add_child>`.
  199. .. rst-class:: classref-item-separator
  200. ----
  201. .. _class_EditorProperty_method_update_property:
  202. .. rst-class:: classref-method
  203. void **update_property** **(** **)** |virtual|
  204. When this virtual function is called, you must update your editor.
  205. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  206. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  207. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  208. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`