class_graphelement.rst 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/GraphElement.xml.
  6. .. _class_GraphElement:
  7. GraphElement
  8. ============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`GraphNode<class_GraphNode>`
  11. A container that represents a basic element that can be placed inside a :ref:`GraphEdit<class_GraphEdit>` control.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. **GraphElement** allows to create custom elements for a :ref:`GraphEdit<class_GraphEdit>` graph. By default such elements can be selected, resized, and repositioned, but they cannot be connected. For a graph element that allows for connections see :ref:`GraphNode<class_GraphNode>`.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------+---------------------------------------------------------------------+-------------------+
  22. | :ref:`bool<class_bool>` | :ref:`draggable<class_GraphElement_property_draggable>` | ``true`` |
  23. +-------------------------------+---------------------------------------------------------------------+-------------------+
  24. | :ref:`Vector2<class_Vector2>` | :ref:`position_offset<class_GraphElement_property_position_offset>` | ``Vector2(0, 0)`` |
  25. +-------------------------------+---------------------------------------------------------------------+-------------------+
  26. | :ref:`bool<class_bool>` | :ref:`resizable<class_GraphElement_property_resizable>` | ``false`` |
  27. +-------------------------------+---------------------------------------------------------------------+-------------------+
  28. | :ref:`bool<class_bool>` | :ref:`selectable<class_GraphElement_property_selectable>` | ``true`` |
  29. +-------------------------------+---------------------------------------------------------------------+-------------------+
  30. | :ref:`bool<class_bool>` | :ref:`selected<class_GraphElement_property_selected>` | ``false`` |
  31. +-------------------------------+---------------------------------------------------------------------+-------------------+
  32. .. rst-class:: classref-reftable-group
  33. Theme Properties
  34. ----------------
  35. .. table::
  36. :widths: auto
  37. +-----------------------------------+-------------------------------------------------------+
  38. | :ref:`Texture2D<class_Texture2D>` | :ref:`resizer<class_GraphElement_theme_icon_resizer>` |
  39. +-----------------------------------+-------------------------------------------------------+
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Signals
  44. -------
  45. .. _class_GraphElement_signal_delete_request:
  46. .. rst-class:: classref-signal
  47. **delete_request** **(** **)**
  48. Emitted when removing the GraphElement is requested.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_GraphElement_signal_dragged:
  52. .. rst-class:: classref-signal
  53. **dragged** **(** :ref:`Vector2<class_Vector2>` from, :ref:`Vector2<class_Vector2>` to **)**
  54. Emitted when the GraphElement is dragged.
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_GraphElement_signal_node_deselected:
  58. .. rst-class:: classref-signal
  59. **node_deselected** **(** **)**
  60. Emitted when the GraphElement is deselected.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_GraphElement_signal_node_selected:
  64. .. rst-class:: classref-signal
  65. **node_selected** **(** **)**
  66. Emitted when the GraphElement is selected.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_GraphElement_signal_position_offset_changed:
  70. .. rst-class:: classref-signal
  71. **position_offset_changed** **(** **)**
  72. Emitted when the GraphElement is moved.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_GraphElement_signal_raise_request:
  76. .. rst-class:: classref-signal
  77. **raise_request** **(** **)**
  78. Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement.
  79. .. rst-class:: classref-item-separator
  80. ----
  81. .. _class_GraphElement_signal_resize_request:
  82. .. rst-class:: classref-signal
  83. **resize_request** **(** :ref:`Vector2<class_Vector2>` new_minsize **)**
  84. Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see :ref:`resizable<class_GraphElement_property_resizable>`).
  85. .. rst-class:: classref-section-separator
  86. ----
  87. .. rst-class:: classref-descriptions-group
  88. Property Descriptions
  89. ---------------------
  90. .. _class_GraphElement_property_draggable:
  91. .. rst-class:: classref-property
  92. :ref:`bool<class_bool>` **draggable** = ``true``
  93. .. rst-class:: classref-property-setget
  94. - void **set_draggable** **(** :ref:`bool<class_bool>` value **)**
  95. - :ref:`bool<class_bool>` **is_draggable** **(** **)**
  96. If ``true``, the user can drag the GraphElement.
  97. .. rst-class:: classref-item-separator
  98. ----
  99. .. _class_GraphElement_property_position_offset:
  100. .. rst-class:: classref-property
  101. :ref:`Vector2<class_Vector2>` **position_offset** = ``Vector2(0, 0)``
  102. .. rst-class:: classref-property-setget
  103. - void **set_position_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  104. - :ref:`Vector2<class_Vector2>` **get_position_offset** **(** **)**
  105. The offset of the GraphElement, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_GraphElement_property_resizable:
  109. .. rst-class:: classref-property
  110. :ref:`bool<class_bool>` **resizable** = ``false``
  111. .. rst-class:: classref-property-setget
  112. - void **set_resizable** **(** :ref:`bool<class_bool>` value **)**
  113. - :ref:`bool<class_bool>` **is_resizable** **(** **)**
  114. If ``true``, the user can resize the GraphElement.
  115. \ **Note:** Dragging the handle will only emit the :ref:`resize_request<class_GraphElement_signal_resize_request>` signal, the GraphElement needs to be resized manually.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_GraphElement_property_selectable:
  119. .. rst-class:: classref-property
  120. :ref:`bool<class_bool>` **selectable** = ``true``
  121. .. rst-class:: classref-property-setget
  122. - void **set_selectable** **(** :ref:`bool<class_bool>` value **)**
  123. - :ref:`bool<class_bool>` **is_selectable** **(** **)**
  124. If ``true``, the user can select the GraphElement.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_GraphElement_property_selected:
  128. .. rst-class:: classref-property
  129. :ref:`bool<class_bool>` **selected** = ``false``
  130. .. rst-class:: classref-property-setget
  131. - void **set_selected** **(** :ref:`bool<class_bool>` value **)**
  132. - :ref:`bool<class_bool>` **is_selected** **(** **)**
  133. If ``true``, the GraphElement is selected.
  134. .. rst-class:: classref-section-separator
  135. ----
  136. .. rst-class:: classref-descriptions-group
  137. Theme Property Descriptions
  138. ---------------------------
  139. .. _class_GraphElement_theme_icon_resizer:
  140. .. rst-class:: classref-themeproperty
  141. :ref:`Texture2D<class_Texture2D>` **resizer**
  142. The icon used for the resizer, visible when :ref:`resizable<class_GraphElement_property_resizable>` is enabled.
  143. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  144. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  145. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  146. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  147. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  148. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  149. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`