class_editorproperty.rst 11 KB

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