class_graphelement.rst 9.2 KB

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