class_editorproperty.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 EditorProperty.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_EditorProperty:
  6. EditorProperty
  7. ==============
  8. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Custom control to edit properties for adding into the inspector.
  13. Properties
  14. ----------
  15. +-----------------------------+-----------------------------------------------------------+-------+
  16. | :ref:`bool<class_bool>` | :ref:`checkable<class_EditorProperty_property_checkable>` | false |
  17. +-----------------------------+-----------------------------------------------------------+-------+
  18. | :ref:`bool<class_bool>` | :ref:`checked<class_EditorProperty_property_checked>` | false |
  19. +-----------------------------+-----------------------------------------------------------+-------+
  20. | :ref:`bool<class_bool>` | :ref:`draw_red<class_EditorProperty_property_draw_red>` | false |
  21. +-----------------------------+-----------------------------------------------------------+-------+
  22. | :ref:`bool<class_bool>` | :ref:`keying<class_EditorProperty_property_keying>` | false |
  23. +-----------------------------+-----------------------------------------------------------+-------+
  24. | :ref:`String<class_String>` | :ref:`label<class_EditorProperty_property_label>` | "" |
  25. +-----------------------------+-----------------------------------------------------------+-------+
  26. | :ref:`bool<class_bool>` | :ref:`read_only<class_EditorProperty_property_read_only>` | false |
  27. +-----------------------------+-----------------------------------------------------------+-------+
  28. Methods
  29. -------
  30. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`add_focusable<class_EditorProperty_method_add_focusable>` **(** :ref:`Control<class_Control>` control **)** |
  32. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | 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 **)** |
  34. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`Object<class_Object>` | :ref:`get_edited_object<class_EditorProperty_method_get_edited_object>` **(** **)** |
  36. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | :ref:`get_edited_property<class_EditorProperty_method_get_edited_property>` **(** **)** |
  38. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`String<class_String>` | :ref:`get_tooltip_text<class_EditorProperty_method_get_tooltip_text>` **(** **)** const |
  40. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_bottom_editor<class_EditorProperty_method_set_bottom_editor>` **(** :ref:`Control<class_Control>` editor **)** |
  42. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`update_property<class_EditorProperty_method_update_property>` **(** **)** virtual |
  44. +-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. Signals
  46. -------
  47. .. _class_EditorProperty_signal_multiple_properties_changed:
  48. - **multiple_properties_changed** **(** :ref:`PoolStringArray<class_PoolStringArray>` properties, :ref:`Array<class_Array>` value **)**
  49. 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>`.
  50. .. _class_EditorProperty_signal_object_id_selected:
  51. - **object_id_selected** **(** :ref:`String<class_String>` property, :ref:`int<class_int>` id **)**
  52. Used by sub-inspectors. Emit it if what was selected was an Object ID.
  53. .. _class_EditorProperty_signal_property_changed:
  54. - **property_changed** **(** :ref:`String<class_String>` property, :ref:`Nil<class_Nil>` value **)**
  55. Do not emit this manually, use the :ref:`emit_changed<class_EditorProperty_method_emit_changed>` method instead.
  56. .. _class_EditorProperty_signal_property_checked:
  57. - **property_checked** **(** :ref:`String<class_String>` property, :ref:`String<class_String>` bool **)**
  58. Emitted when a property was checked. Used internally.
  59. .. _class_EditorProperty_signal_property_keyed:
  60. - **property_keyed** **(** :ref:`String<class_String>` property **)**
  61. Emit it if you want to add this value as an animation key (check for keying being enabled first).
  62. .. _class_EditorProperty_signal_property_keyed_with_value:
  63. - **property_keyed_with_value** **(** :ref:`String<class_String>` property, :ref:`Nil<class_Nil>` value **)**
  64. Emit it if you want to key a property with a single value.
  65. .. _class_EditorProperty_signal_resource_selected:
  66. - **resource_selected** **(** :ref:`String<class_String>` path, :ref:`Resource<class_Resource>` resource **)**
  67. If you want a sub-resource to be edited, emit this signal with the resource.
  68. .. _class_EditorProperty_signal_selected:
  69. - **selected** **(** :ref:`String<class_String>` path, :ref:`int<class_int>` focusable_idx **)**
  70. Emitted when selected. Used internally.
  71. Description
  72. -----------
  73. This control allows property editing for one or multiple properties into :ref:`EditorInspector<class_EditorInspector>`. It is added via :ref:`EditorInspectorPlugin<class_EditorInspectorPlugin>`.
  74. Property Descriptions
  75. ---------------------
  76. .. _class_EditorProperty_property_checkable:
  77. - :ref:`bool<class_bool>` **checkable**
  78. +-----------+----------------------+
  79. | *Default* | false |
  80. +-----------+----------------------+
  81. | *Setter* | set_checkable(value) |
  82. +-----------+----------------------+
  83. | *Getter* | is_checkable() |
  84. +-----------+----------------------+
  85. Used by the inspector, set when property is checkable.
  86. .. _class_EditorProperty_property_checked:
  87. - :ref:`bool<class_bool>` **checked**
  88. +-----------+--------------------+
  89. | *Default* | false |
  90. +-----------+--------------------+
  91. | *Setter* | set_checked(value) |
  92. +-----------+--------------------+
  93. | *Getter* | is_checked() |
  94. +-----------+--------------------+
  95. Used by the inspector, when the property is checked.
  96. .. _class_EditorProperty_property_draw_red:
  97. - :ref:`bool<class_bool>` **draw_red**
  98. +-----------+---------------------+
  99. | *Default* | false |
  100. +-----------+---------------------+
  101. | *Setter* | set_draw_red(value) |
  102. +-----------+---------------------+
  103. | *Getter* | is_draw_red() |
  104. +-----------+---------------------+
  105. Used by the inspector, when the property must draw with error color.
  106. .. _class_EditorProperty_property_keying:
  107. - :ref:`bool<class_bool>` **keying**
  108. +-----------+-------------------+
  109. | *Default* | false |
  110. +-----------+-------------------+
  111. | *Setter* | set_keying(value) |
  112. +-----------+-------------------+
  113. | *Getter* | is_keying() |
  114. +-----------+-------------------+
  115. Used by the inspector, when the property can add keys for animation.
  116. .. _class_EditorProperty_property_label:
  117. - :ref:`String<class_String>` **label**
  118. +-----------+------------------+
  119. | *Default* | "" |
  120. +-----------+------------------+
  121. | *Setter* | set_label(value) |
  122. +-----------+------------------+
  123. | *Getter* | get_label() |
  124. +-----------+------------------+
  125. Sets this property to change the label (if you want to show one).
  126. .. _class_EditorProperty_property_read_only:
  127. - :ref:`bool<class_bool>` **read_only**
  128. +-----------+----------------------+
  129. | *Default* | false |
  130. +-----------+----------------------+
  131. | *Setter* | set_read_only(value) |
  132. +-----------+----------------------+
  133. | *Getter* | is_read_only() |
  134. +-----------+----------------------+
  135. Used by the inspector, when the property is read-only.
  136. Method Descriptions
  137. -------------------
  138. .. _class_EditorProperty_method_add_focusable:
  139. - void **add_focusable** **(** :ref:`Control<class_Control>` control **)**
  140. 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.
  141. .. _class_EditorProperty_method_emit_changed:
  142. - void **emit_changed** **(** :ref:`String<class_String>` property, :ref:`Variant<class_Variant>` value, :ref:`String<class_String>` field="", :ref:`bool<class_bool>` changing=false **)**
  143. 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).
  144. .. _class_EditorProperty_method_get_edited_object:
  145. - :ref:`Object<class_Object>` **get_edited_object** **(** **)**
  146. Gets the edited object.
  147. .. _class_EditorProperty_method_get_edited_property:
  148. - :ref:`String<class_String>` **get_edited_property** **(** **)**
  149. 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.
  150. .. _class_EditorProperty_method_get_tooltip_text:
  151. - :ref:`String<class_String>` **get_tooltip_text** **(** **)** const
  152. Override if you want to allow a custom tooltip over your property.
  153. .. _class_EditorProperty_method_set_bottom_editor:
  154. - void **set_bottom_editor** **(** :ref:`Control<class_Control>` editor **)**
  155. Adds controls with this function if you want them on the bottom (below the label).
  156. .. _class_EditorProperty_method_update_property:
  157. - void **update_property** **(** **)** virtual
  158. When this virtual function is called, you must update your editor.