class_graphelement.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. **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-section-separator
  33. ----
  34. .. rst-class:: classref-descriptions-group
  35. Signals
  36. -------
  37. .. _class_GraphElement_signal_close_request:
  38. .. rst-class:: classref-signal
  39. **close_request** **(** **)**
  40. Emitted when closing the GraphElement is requested.
  41. .. rst-class:: classref-item-separator
  42. ----
  43. .. _class_GraphElement_signal_dragged:
  44. .. rst-class:: classref-signal
  45. **dragged** **(** :ref:`Vector2<class_Vector2>` from, :ref:`Vector2<class_Vector2>` to **)**
  46. Emitted when the GraphElement is dragged.
  47. .. rst-class:: classref-item-separator
  48. ----
  49. .. _class_GraphElement_signal_node_deselected:
  50. .. rst-class:: classref-signal
  51. **node_deselected** **(** **)**
  52. Emitted when the GraphElement is deselected.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_GraphElement_signal_node_selected:
  56. .. rst-class:: classref-signal
  57. **node_selected** **(** **)**
  58. Emitted when the GraphElement is selected.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_GraphElement_signal_position_offset_changed:
  62. .. rst-class:: classref-signal
  63. **position_offset_changed** **(** **)**
  64. Emitted when the GraphElement is moved.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_GraphElement_signal_raise_request:
  68. .. rst-class:: classref-signal
  69. **raise_request** **(** **)**
  70. Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_GraphElement_signal_resize_request:
  74. .. rst-class:: classref-signal
  75. **resize_request** **(** :ref:`Vector2<class_Vector2>` new_minsize **)**
  76. Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see :ref:`resizable<class_GraphElement_property_resizable>`).
  77. .. rst-class:: classref-section-separator
  78. ----
  79. .. rst-class:: classref-descriptions-group
  80. Property Descriptions
  81. ---------------------
  82. .. _class_GraphElement_property_draggable:
  83. .. rst-class:: classref-property
  84. :ref:`bool<class_bool>` **draggable** = ``true``
  85. .. rst-class:: classref-property-setget
  86. - void **set_draggable** **(** :ref:`bool<class_bool>` value **)**
  87. - :ref:`bool<class_bool>` **is_draggable** **(** **)**
  88. If ``true``, the user can drag the GraphElement.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_GraphElement_property_position_offset:
  92. .. rst-class:: classref-property
  93. :ref:`Vector2<class_Vector2>` **position_offset** = ``Vector2(0, 0)``
  94. .. rst-class:: classref-property-setget
  95. - void **set_position_offset** **(** :ref:`Vector2<class_Vector2>` value **)**
  96. - :ref:`Vector2<class_Vector2>` **get_position_offset** **(** **)**
  97. The offset of the GraphElement, relative to the scroll offset of the :ref:`GraphEdit<class_GraphEdit>`.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_GraphElement_property_resizable:
  101. .. rst-class:: classref-property
  102. :ref:`bool<class_bool>` **resizable** = ``false``
  103. .. rst-class:: classref-property-setget
  104. - void **set_resizable** **(** :ref:`bool<class_bool>` value **)**
  105. - :ref:`bool<class_bool>` **is_resizable** **(** **)**
  106. If ``true``, the user can resize the GraphElement.
  107. \ **Note:** Dragging the handle will only emit the :ref:`resize_request<class_GraphElement_signal_resize_request>` signal, the GraphElement needs to be resized manually.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_GraphElement_property_selectable:
  111. .. rst-class:: classref-property
  112. :ref:`bool<class_bool>` **selectable** = ``true``
  113. .. rst-class:: classref-property-setget
  114. - void **set_selectable** **(** :ref:`bool<class_bool>` value **)**
  115. - :ref:`bool<class_bool>` **is_selectable** **(** **)**
  116. If ``true``, the user can select the GraphElement.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _class_GraphElement_property_selected:
  120. .. rst-class:: classref-property
  121. :ref:`bool<class_bool>` **selected** = ``false``
  122. .. rst-class:: classref-property-setget
  123. - void **set_selected** **(** :ref:`bool<class_bool>` value **)**
  124. - :ref:`bool<class_bool>` **is_selected** **(** **)**
  125. If ``true``, the GraphElement is selected.
  126. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  127. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  128. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  129. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  130. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  131. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  132. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`