class_graphedit.rst 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  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/GraphEdit.xml.
  6. .. _class_GraphEdit:
  7. GraphEdit
  8. =========
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. GraphEdit is a control responsible for displaying and manipulating graph-like data using :ref:`GraphNode<class_GraphNode>`\ s. It provides access to creation, removal, connection, and disconnection of nodes.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **Note:** Please be aware that this node will undergo extensive refactoring in a future 4.x version involving compatibility-breaking API changes.
  15. GraphEdit provides tools for creation, manipulation, and display of various graphs. Its main purpose in the engine is to power the visual programming systems, such as visual shaders, but it is also available for use in user projects.
  16. GraphEdit by itself is only an empty container, representing an infinite grid where :ref:`GraphNode<class_GraphNode>`\ s can be placed. Each :ref:`GraphNode<class_GraphNode>` represent a node in the graph, a single unit of data in the connected scheme. GraphEdit, in turn, helps to control various interactions with nodes and between nodes. When the user attempts to connect, disconnect, or close a :ref:`GraphNode<class_GraphNode>`, a signal is emitted in the GraphEdit, but no action is taken by default. It is the responsibility of the programmer utilizing this control to implement the necessary logic to determine how each request should be handled.
  17. \ **Performance:** It is greatly advised to enable low-processor usage mode (see :ref:`OS.low_processor_usage_mode<class_OS_property_low_processor_usage_mode>`) when using GraphEdits.
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`arrange_nodes_button_hidden<class_GraphEdit_property_arrange_nodes_button_hidden>` | ``false`` |
  25. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  26. | :ref:`bool<class_bool>` | clip_contents | ``true`` (overrides :ref:`Control<class_Control_property_clip_contents>`) |
  27. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`connection_lines_antialiased<class_GraphEdit_property_connection_lines_antialiased>` | ``true`` |
  29. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`connection_lines_curvature<class_GraphEdit_property_connection_lines_curvature>` | ``0.5`` |
  31. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`connection_lines_thickness<class_GraphEdit_property_connection_lines_thickness>` | ``2.0`` |
  33. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  34. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  35. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`minimap_enabled<class_GraphEdit_property_minimap_enabled>` | ``true`` |
  37. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`minimap_opacity<class_GraphEdit_property_minimap_opacity>` | ``0.65`` |
  39. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  40. | :ref:`Vector2<class_Vector2>` | :ref:`minimap_size<class_GraphEdit_property_minimap_size>` | ``Vector2(240, 160)`` |
  41. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  42. | :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` | :ref:`panning_scheme<class_GraphEdit_property_panning_scheme>` | ``0`` |
  43. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  44. | :ref:`bool<class_bool>` | :ref:`right_disconnects<class_GraphEdit_property_right_disconnects>` | ``false`` |
  45. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  46. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_GraphEdit_property_scroll_offset>` | ``Vector2(0, 0)`` |
  47. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`show_zoom_label<class_GraphEdit_property_show_zoom_label>` | ``false`` |
  49. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`snap_distance<class_GraphEdit_property_snap_distance>` | ``20`` |
  51. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`use_snap<class_GraphEdit_property_use_snap>` | ``true`` |
  53. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  54. | :ref:`float<class_float>` | :ref:`zoom<class_GraphEdit_property_zoom>` | ``1.0`` |
  55. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`zoom_max<class_GraphEdit_property_zoom_max>` | ``2.0736`` |
  57. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  58. | :ref:`float<class_float>` | :ref:`zoom_min<class_GraphEdit_property_zoom_min>` | ``0.232568`` |
  59. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  60. | :ref:`float<class_float>` | :ref:`zoom_step<class_GraphEdit_property_zoom_step>` | ``1.2`` |
  61. +----------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  62. .. rst-class:: classref-reftable-group
  63. Methods
  64. -------
  65. .. table::
  66. :widths: auto
  67. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`_get_connection_line<class_GraphEdit_method__get_connection_line>` **(** :ref:`Vector2<class_Vector2>` from_position, :ref:`Vector2<class_Vector2>` to_position **)** |virtual| |const| |
  69. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`bool<class_bool>` | :ref:`_is_in_input_hotzone<class_GraphEdit_method__is_in_input_hotzone>` **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual| |
  71. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`bool<class_bool>` | :ref:`_is_in_output_hotzone<class_GraphEdit_method__is_in_output_hotzone>` **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual| |
  73. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`_is_node_hover_valid<class_GraphEdit_method__is_node_hover_valid>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |virtual| |
  75. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |
  77. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`add_valid_left_disconnect_type<class_GraphEdit_method_add_valid_left_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
  79. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`add_valid_right_disconnect_type<class_GraphEdit_method_add_valid_right_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
  81. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`arrange_nodes<class_GraphEdit_method_arrange_nodes>` **(** **)** |
  83. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`clear_connections<class_GraphEdit_method_clear_connections>` **(** **)** |
  85. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_node<class_GraphEdit_method_connect_node>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
  87. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | void | :ref:`disconnect_node<class_GraphEdit_method_disconnect_node>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
  89. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`force_connection_drag_end<class_GraphEdit_method_force_connection_drag_end>` **(** **)** |
  91. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_connection_line<class_GraphEdit_method_get_connection_line>` **(** :ref:`Vector2<class_Vector2>` from_node, :ref:`Vector2<class_Vector2>` to_node **)** |
  93. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | :ref:`Dictionary[]<class_Dictionary>` | :ref:`get_connection_list<class_GraphEdit_method_get_connection_list>` **(** **)** |const| |
  95. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | :ref:`HBoxContainer<class_HBoxContainer>` | :ref:`get_zoom_hbox<class_GraphEdit_method_get_zoom_hbox>` **(** **)** |
  97. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | :ref:`bool<class_bool>` | :ref:`is_node_connected<class_GraphEdit_method_is_node_connected>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |
  99. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | :ref:`bool<class_bool>` | :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |const| |
  101. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>` **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |
  103. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`remove_valid_left_disconnect_type<class_GraphEdit_method_remove_valid_left_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
  105. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`remove_valid_right_disconnect_type<class_GraphEdit_method_remove_valid_right_disconnect_type>` **(** :ref:`int<class_int>` type **)** |
  107. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_connection_activity<class_GraphEdit_method_set_connection_activity>` **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`float<class_float>` amount **)** |
  109. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_selected<class_GraphEdit_method_set_selected>` **(** :ref:`Node<class_Node>` node **)** |
  111. +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. .. rst-class:: classref-reftable-group
  113. Theme Properties
  114. ----------------
  115. .. table::
  116. :widths: auto
  117. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  118. | :ref:`Color<class_Color>` | :ref:`activity<class_GraphEdit_theme_color_activity>` | ``Color(1, 1, 1, 1)`` |
  119. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  120. | :ref:`Color<class_Color>` | :ref:`grid_major<class_GraphEdit_theme_color_grid_major>` | ``Color(1, 1, 1, 0.2)`` |
  121. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  122. | :ref:`Color<class_Color>` | :ref:`grid_minor<class_GraphEdit_theme_color_grid_minor>` | ``Color(1, 1, 1, 0.05)`` |
  123. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  124. | :ref:`Color<class_Color>` | :ref:`selection_fill<class_GraphEdit_theme_color_selection_fill>` | ``Color(1, 1, 1, 0.3)`` |
  125. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  126. | :ref:`Color<class_Color>` | :ref:`selection_stroke<class_GraphEdit_theme_color_selection_stroke>` | ``Color(1, 1, 1, 0.8)`` |
  127. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  128. | :ref:`int<class_int>` | :ref:`port_hotzone_inner_extent<class_GraphEdit_theme_constant_port_hotzone_inner_extent>` | ``22`` |
  129. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  130. | :ref:`int<class_int>` | :ref:`port_hotzone_outer_extent<class_GraphEdit_theme_constant_port_hotzone_outer_extent>` | ``26`` |
  131. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  132. | :ref:`Texture2D<class_Texture2D>` | :ref:`layout<class_GraphEdit_theme_icon_layout>` | |
  133. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  134. | :ref:`Texture2D<class_Texture2D>` | :ref:`minimap<class_GraphEdit_theme_icon_minimap>` | |
  135. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  136. | :ref:`Texture2D<class_Texture2D>` | :ref:`minus<class_GraphEdit_theme_icon_minus>` | |
  137. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  138. | :ref:`Texture2D<class_Texture2D>` | :ref:`more<class_GraphEdit_theme_icon_more>` | |
  139. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  140. | :ref:`Texture2D<class_Texture2D>` | :ref:`reset<class_GraphEdit_theme_icon_reset>` | |
  141. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  142. | :ref:`Texture2D<class_Texture2D>` | :ref:`snap<class_GraphEdit_theme_icon_snap>` | |
  143. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  144. | :ref:`StyleBox<class_StyleBox>` | :ref:`bg<class_GraphEdit_theme_style_bg>` | |
  145. +-----------------------------------+--------------------------------------------------------------------------------------------+--------------------------+
  146. .. rst-class:: classref-section-separator
  147. ----
  148. .. rst-class:: classref-descriptions-group
  149. Signals
  150. -------
  151. .. _class_GraphEdit_signal_begin_node_move:
  152. .. rst-class:: classref-signal
  153. **begin_node_move** **(** **)**
  154. Emitted at the beginning of a GraphNode movement.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_GraphEdit_signal_connection_drag_ended:
  158. .. rst-class:: classref-signal
  159. **connection_drag_ended** **(** **)**
  160. Emitted at the end of a connection drag.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_GraphEdit_signal_connection_drag_started:
  164. .. rst-class:: classref-signal
  165. **connection_drag_started** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`bool<class_bool>` is_output **)**
  166. Emitted at the beginning of a connection drag.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_GraphEdit_signal_connection_from_empty:
  170. .. rst-class:: classref-signal
  171. **connection_from_empty** **(** :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`Vector2<class_Vector2>` release_position **)**
  172. Emitted when user drags a connection from an input port into the empty space of the graph.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_GraphEdit_signal_connection_request:
  176. .. rst-class:: classref-signal
  177. **connection_request** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
  178. Emitted to the GraphEdit when the connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>` is attempted to be created.
  179. .. rst-class:: classref-item-separator
  180. ----
  181. .. _class_GraphEdit_signal_connection_to_empty:
  182. .. rst-class:: classref-signal
  183. **connection_to_empty** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`Vector2<class_Vector2>` release_position **)**
  184. Emitted when user drags a connection from an output port into the empty space of the graph.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_GraphEdit_signal_copy_nodes_request:
  188. .. rst-class:: classref-signal
  189. **copy_nodes_request** **(** **)**
  190. Emitted when the user presses :kbd:`Ctrl + C`.
  191. .. rst-class:: classref-item-separator
  192. ----
  193. .. _class_GraphEdit_signal_delete_nodes_request:
  194. .. rst-class:: classref-signal
  195. **delete_nodes_request** **(** :ref:`StringName[]<class_StringName>` nodes **)**
  196. Emitted when a GraphNode is attempted to be removed from the GraphEdit. Provides a list of node names to be removed (all selected nodes, excluding nodes without closing button).
  197. .. rst-class:: classref-item-separator
  198. ----
  199. .. _class_GraphEdit_signal_disconnection_request:
  200. .. rst-class:: classref-signal
  201. **disconnection_request** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
  202. Emitted to the GraphEdit when the connection between ``from_port`` of ``from_node`` :ref:`GraphNode<class_GraphNode>` and ``to_port`` of ``to_node`` :ref:`GraphNode<class_GraphNode>` is attempted to be removed.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_GraphEdit_signal_duplicate_nodes_request:
  206. .. rst-class:: classref-signal
  207. **duplicate_nodes_request** **(** **)**
  208. Emitted when a GraphNode is attempted to be duplicated in the GraphEdit.
  209. .. rst-class:: classref-item-separator
  210. ----
  211. .. _class_GraphEdit_signal_end_node_move:
  212. .. rst-class:: classref-signal
  213. **end_node_move** **(** **)**
  214. Emitted at the end of a GraphNode movement.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_GraphEdit_signal_node_deselected:
  218. .. rst-class:: classref-signal
  219. **node_deselected** **(** :ref:`Node<class_Node>` node **)**
  220. .. container:: contribute
  221. There is currently no description for this signal. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_GraphEdit_signal_node_selected:
  225. .. rst-class:: classref-signal
  226. **node_selected** **(** :ref:`Node<class_Node>` node **)**
  227. Emitted when a GraphNode is selected.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_GraphEdit_signal_paste_nodes_request:
  231. .. rst-class:: classref-signal
  232. **paste_nodes_request** **(** **)**
  233. Emitted when the user presses :kbd:`Ctrl + V`.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_GraphEdit_signal_popup_request:
  237. .. rst-class:: classref-signal
  238. **popup_request** **(** :ref:`Vector2<class_Vector2>` position **)**
  239. Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. ``position`` is the position of the mouse pointer when the signal is sent.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_GraphEdit_signal_scroll_offset_changed:
  243. .. rst-class:: classref-signal
  244. **scroll_offset_changed** **(** :ref:`Vector2<class_Vector2>` offset **)**
  245. Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code.
  246. .. rst-class:: classref-section-separator
  247. ----
  248. .. rst-class:: classref-descriptions-group
  249. Enumerations
  250. ------------
  251. .. _enum_GraphEdit_PanningScheme:
  252. .. rst-class:: classref-enumeration
  253. enum **PanningScheme**:
  254. .. _class_GraphEdit_constant_SCROLL_ZOOMS:
  255. .. rst-class:: classref-enumeration-constant
  256. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_ZOOMS** = ``0``
  257. :kbd:`Mouse Wheel` will zoom, :kbd:`Ctrl + Mouse Wheel` will move the view.
  258. .. _class_GraphEdit_constant_SCROLL_PANS:
  259. .. rst-class:: classref-enumeration-constant
  260. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_PANS** = ``1``
  261. :kbd:`Mouse Wheel` will move the view, :kbd:`Ctrl + Mouse Wheel` will zoom.
  262. .. rst-class:: classref-section-separator
  263. ----
  264. .. rst-class:: classref-descriptions-group
  265. Property Descriptions
  266. ---------------------
  267. .. _class_GraphEdit_property_arrange_nodes_button_hidden:
  268. .. rst-class:: classref-property
  269. :ref:`bool<class_bool>` **arrange_nodes_button_hidden** = ``false``
  270. .. rst-class:: classref-property-setget
  271. - void **set_arrange_nodes_button_hidden** **(** :ref:`bool<class_bool>` value **)**
  272. - :ref:`bool<class_bool>` **is_arrange_nodes_button_hidden** **(** **)**
  273. If ``true``, the Arrange Nodes button is hidden.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_GraphEdit_property_connection_lines_antialiased:
  277. .. rst-class:: classref-property
  278. :ref:`bool<class_bool>` **connection_lines_antialiased** = ``true``
  279. .. rst-class:: classref-property-setget
  280. - void **set_connection_lines_antialiased** **(** :ref:`bool<class_bool>` value **)**
  281. - :ref:`bool<class_bool>` **is_connection_lines_antialiased** **(** **)**
  282. If ``true``, the lines between nodes will use antialiasing.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_GraphEdit_property_connection_lines_curvature:
  286. .. rst-class:: classref-property
  287. :ref:`float<class_float>` **connection_lines_curvature** = ``0.5``
  288. .. rst-class:: classref-property-setget
  289. - void **set_connection_lines_curvature** **(** :ref:`float<class_float>` value **)**
  290. - :ref:`float<class_float>` **get_connection_lines_curvature** **(** **)**
  291. The curvature of the lines between the nodes. 0 results in straight lines.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_GraphEdit_property_connection_lines_thickness:
  295. .. rst-class:: classref-property
  296. :ref:`float<class_float>` **connection_lines_thickness** = ``2.0``
  297. .. rst-class:: classref-property-setget
  298. - void **set_connection_lines_thickness** **(** :ref:`float<class_float>` value **)**
  299. - :ref:`float<class_float>` **get_connection_lines_thickness** **(** **)**
  300. The thickness of the lines between the nodes.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_GraphEdit_property_minimap_enabled:
  304. .. rst-class:: classref-property
  305. :ref:`bool<class_bool>` **minimap_enabled** = ``true``
  306. .. rst-class:: classref-property-setget
  307. - void **set_minimap_enabled** **(** :ref:`bool<class_bool>` value **)**
  308. - :ref:`bool<class_bool>` **is_minimap_enabled** **(** **)**
  309. If ``true``, the minimap is visible.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_GraphEdit_property_minimap_opacity:
  313. .. rst-class:: classref-property
  314. :ref:`float<class_float>` **minimap_opacity** = ``0.65``
  315. .. rst-class:: classref-property-setget
  316. - void **set_minimap_opacity** **(** :ref:`float<class_float>` value **)**
  317. - :ref:`float<class_float>` **get_minimap_opacity** **(** **)**
  318. The opacity of the minimap rectangle.
  319. .. rst-class:: classref-item-separator
  320. ----
  321. .. _class_GraphEdit_property_minimap_size:
  322. .. rst-class:: classref-property
  323. :ref:`Vector2<class_Vector2>` **minimap_size** = ``Vector2(240, 160)``
  324. .. rst-class:: classref-property-setget
  325. - void **set_minimap_size** **(** :ref:`Vector2<class_Vector2>` value **)**
  326. - :ref:`Vector2<class_Vector2>` **get_minimap_size** **(** **)**
  327. The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_GraphEdit_property_panning_scheme:
  331. .. rst-class:: classref-property
  332. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **panning_scheme** = ``0``
  333. .. rst-class:: classref-property-setget
  334. - void **set_panning_scheme** **(** :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` value **)**
  335. - :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **get_panning_scheme** **(** **)**
  336. Defines the control scheme for panning with mouse wheel.
  337. .. rst-class:: classref-item-separator
  338. ----
  339. .. _class_GraphEdit_property_right_disconnects:
  340. .. rst-class:: classref-property
  341. :ref:`bool<class_bool>` **right_disconnects** = ``false``
  342. .. rst-class:: classref-property-setget
  343. - void **set_right_disconnects** **(** :ref:`bool<class_bool>` value **)**
  344. - :ref:`bool<class_bool>` **is_right_disconnects_enabled** **(** **)**
  345. If ``true``, enables disconnection of existing connections in the GraphEdit by dragging the right end.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_GraphEdit_property_scroll_offset:
  349. .. rst-class:: classref-property
  350. :ref:`Vector2<class_Vector2>` **scroll_offset** = ``Vector2(0, 0)``
  351. .. rst-class:: classref-property-setget
  352. - void **set_scroll_ofs** **(** :ref:`Vector2<class_Vector2>` value **)**
  353. - :ref:`Vector2<class_Vector2>` **get_scroll_ofs** **(** **)**
  354. The scroll offset.
  355. .. rst-class:: classref-item-separator
  356. ----
  357. .. _class_GraphEdit_property_show_zoom_label:
  358. .. rst-class:: classref-property
  359. :ref:`bool<class_bool>` **show_zoom_label** = ``false``
  360. .. rst-class:: classref-property-setget
  361. - void **set_show_zoom_label** **(** :ref:`bool<class_bool>` value **)**
  362. - :ref:`bool<class_bool>` **is_showing_zoom_label** **(** **)**
  363. If ``true``, makes a label with the current zoom level visible. The zoom value is displayed in percents.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_GraphEdit_property_snap_distance:
  367. .. rst-class:: classref-property
  368. :ref:`int<class_int>` **snap_distance** = ``20``
  369. .. rst-class:: classref-property-setget
  370. - void **set_snap** **(** :ref:`int<class_int>` value **)**
  371. - :ref:`int<class_int>` **get_snap** **(** **)**
  372. The snapping distance in pixels.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_GraphEdit_property_use_snap:
  376. .. rst-class:: classref-property
  377. :ref:`bool<class_bool>` **use_snap** = ``true``
  378. .. rst-class:: classref-property-setget
  379. - void **set_use_snap** **(** :ref:`bool<class_bool>` value **)**
  380. - :ref:`bool<class_bool>` **is_using_snap** **(** **)**
  381. If ``true``, enables snapping.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_GraphEdit_property_zoom:
  385. .. rst-class:: classref-property
  386. :ref:`float<class_float>` **zoom** = ``1.0``
  387. .. rst-class:: classref-property-setget
  388. - void **set_zoom** **(** :ref:`float<class_float>` value **)**
  389. - :ref:`float<class_float>` **get_zoom** **(** **)**
  390. The current zoom value.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_GraphEdit_property_zoom_max:
  394. .. rst-class:: classref-property
  395. :ref:`float<class_float>` **zoom_max** = ``2.0736``
  396. .. rst-class:: classref-property-setget
  397. - void **set_zoom_max** **(** :ref:`float<class_float>` value **)**
  398. - :ref:`float<class_float>` **get_zoom_max** **(** **)**
  399. The upper zoom limit.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_GraphEdit_property_zoom_min:
  403. .. rst-class:: classref-property
  404. :ref:`float<class_float>` **zoom_min** = ``0.232568``
  405. .. rst-class:: classref-property-setget
  406. - void **set_zoom_min** **(** :ref:`float<class_float>` value **)**
  407. - :ref:`float<class_float>` **get_zoom_min** **(** **)**
  408. The lower zoom limit.
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_GraphEdit_property_zoom_step:
  412. .. rst-class:: classref-property
  413. :ref:`float<class_float>` **zoom_step** = ``1.2``
  414. .. rst-class:: classref-property-setget
  415. - void **set_zoom_step** **(** :ref:`float<class_float>` value **)**
  416. - :ref:`float<class_float>` **get_zoom_step** **(** **)**
  417. The step of each zoom level.
  418. .. rst-class:: classref-section-separator
  419. ----
  420. .. rst-class:: classref-descriptions-group
  421. Method Descriptions
  422. -------------------
  423. .. _class_GraphEdit_method__get_connection_line:
  424. .. rst-class:: classref-method
  425. :ref:`PackedVector2Array<class_PackedVector2Array>` **_get_connection_line** **(** :ref:`Vector2<class_Vector2>` from_position, :ref:`Vector2<class_Vector2>` to_position **)** |virtual| |const|
  426. Virtual method which can be overridden to customize how connections are drawn.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_GraphEdit_method__is_in_input_hotzone:
  430. .. rst-class:: classref-method
  431. :ref:`bool<class_bool>` **_is_in_input_hotzone** **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual|
  432. Returns whether the ``mouse_position`` is in the input hot zone.
  433. By default, a hot zone is a :ref:`Rect2<class_Rect2>` positioned such that its center is at ``in_node``.\ :ref:`GraphNode.get_connection_input_position<class_GraphNode_method_get_connection_input_position>`\ (``in_port``) (For output's case, call :ref:`GraphNode.get_connection_output_position<class_GraphNode_method_get_connection_output_position>` instead). The hot zone's width is twice the Theme Property ``port_grab_distance_horizontal``, and its height is twice the ``port_grab_distance_vertical``.
  434. Below is a sample code to help get started:
  435. ::
  436. func _is_in_input_hotzone(in_node, in_port, mouse_position):
  437. var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
  438. var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_input_position(in_port) - port_size / 2
  439. var rect = Rect2(port_pos, port_size)
  440. return rect.has_point(mouse_position)
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_GraphEdit_method__is_in_output_hotzone:
  444. .. rst-class:: classref-method
  445. :ref:`bool<class_bool>` **_is_in_output_hotzone** **(** :ref:`Object<class_Object>` in_node, :ref:`int<class_int>` in_port, :ref:`Vector2<class_Vector2>` mouse_position **)** |virtual|
  446. Returns whether the ``mouse_position`` is in the output hot zone. For more information on hot zones, see :ref:`_is_in_input_hotzone<class_GraphEdit_method__is_in_input_hotzone>`.
  447. Below is a sample code to help get started:
  448. ::
  449. func _is_in_output_hotzone(in_node, in_port, mouse_position):
  450. var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
  451. var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_output_position(in_port) - port_size / 2
  452. var rect = Rect2(port_pos, port_size)
  453. return rect.has_point(mouse_position)
  454. .. rst-class:: classref-item-separator
  455. ----
  456. .. _class_GraphEdit_method__is_node_hover_valid:
  457. .. rst-class:: classref-method
  458. :ref:`bool<class_bool>` **_is_node_hover_valid** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)** |virtual|
  459. This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port.
  460. Return ``true`` if the connection is indeed valid or return ``false`` if the connection is impossible. If the connection is impossible, no snapping to the port and thus no connection request to that port will happen.
  461. In this example a connection to same node is suppressed:
  462. .. tabs::
  463. .. code-tab:: gdscript
  464. func _is_node_hover_valid(from, from_port, to, to_port):
  465. return from != to
  466. .. code-tab:: csharp
  467. public override bool _IsNodeHoverValid(StringName fromNode, int fromPort, StringName toNode, int toPort)
  468. {
  469. return fromNode != toNode;
  470. }
  471. .. rst-class:: classref-item-separator
  472. ----
  473. .. _class_GraphEdit_method_add_valid_connection_type:
  474. .. rst-class:: classref-method
  475. void **add_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)**
  476. Allows the connection between two different port types. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
  477. See also :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>` and :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>`.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_GraphEdit_method_add_valid_left_disconnect_type:
  481. .. rst-class:: classref-method
  482. void **add_valid_left_disconnect_type** **(** :ref:`int<class_int>` type **)**
  483. Allows to disconnect nodes when dragging from the left port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. See also :ref:`remove_valid_left_disconnect_type<class_GraphEdit_method_remove_valid_left_disconnect_type>`.
  484. .. rst-class:: classref-item-separator
  485. ----
  486. .. _class_GraphEdit_method_add_valid_right_disconnect_type:
  487. .. rst-class:: classref-method
  488. void **add_valid_right_disconnect_type** **(** :ref:`int<class_int>` type **)**
  489. Allows to disconnect nodes when dragging from the right port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. See also :ref:`remove_valid_right_disconnect_type<class_GraphEdit_method_remove_valid_right_disconnect_type>`.
  490. .. rst-class:: classref-item-separator
  491. ----
  492. .. _class_GraphEdit_method_arrange_nodes:
  493. .. rst-class:: classref-method
  494. void **arrange_nodes** **(** **)**
  495. Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_GraphEdit_method_clear_connections:
  499. .. rst-class:: classref-method
  500. void **clear_connections** **(** **)**
  501. Removes all connections between nodes.
  502. .. rst-class:: classref-item-separator
  503. ----
  504. .. _class_GraphEdit_method_connect_node:
  505. .. rst-class:: classref-method
  506. :ref:`Error<enum_@GlobalScope_Error>` **connect_node** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
  507. Create a connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`. If the connection already exists, no connection is created.
  508. .. rst-class:: classref-item-separator
  509. ----
  510. .. _class_GraphEdit_method_disconnect_node:
  511. .. rst-class:: classref-method
  512. void **disconnect_node** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
  513. Removes the connection between the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` and the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`. If the connection does not exist, no connection is removed.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_GraphEdit_method_force_connection_drag_end:
  517. .. rst-class:: classref-method
  518. void **force_connection_drag_end** **(** **)**
  519. Ends the creation of the current connection. In other words, if you are dragging a connection you can use this method to abort the process and remove the line that followed your cursor.
  520. This is best used together with :ref:`connection_drag_started<class_GraphEdit_signal_connection_drag_started>` and :ref:`connection_drag_ended<class_GraphEdit_signal_connection_drag_ended>` to add custom behavior like node addition through shortcuts.
  521. \ **Note:** This method suppresses any other connection request signals apart from :ref:`connection_drag_ended<class_GraphEdit_signal_connection_drag_ended>`.
  522. .. rst-class:: classref-item-separator
  523. ----
  524. .. _class_GraphEdit_method_get_connection_line:
  525. .. rst-class:: classref-method
  526. :ref:`PackedVector2Array<class_PackedVector2Array>` **get_connection_line** **(** :ref:`Vector2<class_Vector2>` from_node, :ref:`Vector2<class_Vector2>` to_node **)**
  527. Returns the points which would make up a connection between ``from_node`` and ``to_node``.
  528. .. rst-class:: classref-item-separator
  529. ----
  530. .. _class_GraphEdit_method_get_connection_list:
  531. .. rst-class:: classref-method
  532. :ref:`Dictionary[]<class_Dictionary>` **get_connection_list** **(** **)** |const|
  533. Returns an Array containing the list of connections. A connection consists in a structure of the form ``{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }``.
  534. .. rst-class:: classref-item-separator
  535. ----
  536. .. _class_GraphEdit_method_get_zoom_hbox:
  537. .. rst-class:: classref-method
  538. :ref:`HBoxContainer<class_HBoxContainer>` **get_zoom_hbox** **(** **)**
  539. Gets the :ref:`HBoxContainer<class_HBoxContainer>` that contains the zooming and grid snap controls in the top left of the graph. You can use this method to reposition the toolbar or to add your own custom controls to it.
  540. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_GraphEdit_method_is_node_connected:
  544. .. rst-class:: classref-method
  545. :ref:`bool<class_bool>` **is_node_connected** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port **)**
  546. Returns ``true`` if the ``from_port`` of the ``from_node`` :ref:`GraphNode<class_GraphNode>` is connected to the ``to_port`` of the ``to_node`` :ref:`GraphNode<class_GraphNode>`.
  547. .. rst-class:: classref-item-separator
  548. ----
  549. .. _class_GraphEdit_method_is_valid_connection_type:
  550. .. rst-class:: classref-method
  551. :ref:`bool<class_bool>` **is_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)** |const|
  552. Returns whether it's possible to make a connection between two different port types. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
  553. See also :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>` and :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>`.
  554. .. rst-class:: classref-item-separator
  555. ----
  556. .. _class_GraphEdit_method_remove_valid_connection_type:
  557. .. rst-class:: classref-method
  558. void **remove_valid_connection_type** **(** :ref:`int<class_int>` from_type, :ref:`int<class_int>` to_type **)**
  559. Disallows the connection between two different port types previously allowed by :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>`. The port type is defined individually for the left and the right port of each slot with the :ref:`GraphNode.set_slot<class_GraphNode_method_set_slot>` method.
  560. See also :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>`.
  561. .. rst-class:: classref-item-separator
  562. ----
  563. .. _class_GraphEdit_method_remove_valid_left_disconnect_type:
  564. .. rst-class:: classref-method
  565. void **remove_valid_left_disconnect_type** **(** :ref:`int<class_int>` type **)**
  566. Disallows to disconnect nodes when dragging from the left port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. Use this to disable disconnection previously allowed with :ref:`add_valid_left_disconnect_type<class_GraphEdit_method_add_valid_left_disconnect_type>`.
  567. .. rst-class:: classref-item-separator
  568. ----
  569. .. _class_GraphEdit_method_remove_valid_right_disconnect_type:
  570. .. rst-class:: classref-method
  571. void **remove_valid_right_disconnect_type** **(** :ref:`int<class_int>` type **)**
  572. Disallows to disconnect nodes when dragging from the right port of the :ref:`GraphNode<class_GraphNode>`'s slot if it has the specified type. Use this to disable disconnection previously allowed with :ref:`add_valid_right_disconnect_type<class_GraphEdit_method_add_valid_right_disconnect_type>`.
  573. .. rst-class:: classref-item-separator
  574. ----
  575. .. _class_GraphEdit_method_set_connection_activity:
  576. .. rst-class:: classref-method
  577. void **set_connection_activity** **(** :ref:`StringName<class_StringName>` from_node, :ref:`int<class_int>` from_port, :ref:`StringName<class_StringName>` to_node, :ref:`int<class_int>` to_port, :ref:`float<class_float>` amount **)**
  578. Sets the coloration of the connection between ``from_node``'s ``from_port`` and ``to_node``'s ``to_port`` with the color provided in the :ref:`activity<class_GraphEdit_theme_color_activity>` theme property.
  579. .. rst-class:: classref-item-separator
  580. ----
  581. .. _class_GraphEdit_method_set_selected:
  582. .. rst-class:: classref-method
  583. void **set_selected** **(** :ref:`Node<class_Node>` node **)**
  584. Sets the specified ``node`` as the one selected.
  585. .. rst-class:: classref-section-separator
  586. ----
  587. .. rst-class:: classref-descriptions-group
  588. Theme Property Descriptions
  589. ---------------------------
  590. .. _class_GraphEdit_theme_color_activity:
  591. .. rst-class:: classref-themeproperty
  592. :ref:`Color<class_Color>` **activity** = ``Color(1, 1, 1, 1)``
  593. .. container:: contribute
  594. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_GraphEdit_theme_color_grid_major:
  598. .. rst-class:: classref-themeproperty
  599. :ref:`Color<class_Color>` **grid_major** = ``Color(1, 1, 1, 0.2)``
  600. Color of major grid lines.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_GraphEdit_theme_color_grid_minor:
  604. .. rst-class:: classref-themeproperty
  605. :ref:`Color<class_Color>` **grid_minor** = ``Color(1, 1, 1, 0.05)``
  606. Color of minor grid lines.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_GraphEdit_theme_color_selection_fill:
  610. .. rst-class:: classref-themeproperty
  611. :ref:`Color<class_Color>` **selection_fill** = ``Color(1, 1, 1, 0.3)``
  612. The fill color of the selection rectangle.
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_GraphEdit_theme_color_selection_stroke:
  616. .. rst-class:: classref-themeproperty
  617. :ref:`Color<class_Color>` **selection_stroke** = ``Color(1, 1, 1, 0.8)``
  618. The outline color of the selection rectangle.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _class_GraphEdit_theme_constant_port_hotzone_inner_extent:
  622. .. rst-class:: classref-themeproperty
  623. :ref:`int<class_int>` **port_hotzone_inner_extent** = ``22``
  624. The horizontal range within which a port can be grabbed (inner side).
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_GraphEdit_theme_constant_port_hotzone_outer_extent:
  628. .. rst-class:: classref-themeproperty
  629. :ref:`int<class_int>` **port_hotzone_outer_extent** = ``26``
  630. The horizontal range within which a port can be grabbed (outer side).
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_GraphEdit_theme_icon_layout:
  634. .. rst-class:: classref-themeproperty
  635. :ref:`Texture2D<class_Texture2D>` **layout**
  636. .. container:: contribute
  637. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  638. .. rst-class:: classref-item-separator
  639. ----
  640. .. _class_GraphEdit_theme_icon_minimap:
  641. .. rst-class:: classref-themeproperty
  642. :ref:`Texture2D<class_Texture2D>` **minimap**
  643. .. container:: contribute
  644. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  645. .. rst-class:: classref-item-separator
  646. ----
  647. .. _class_GraphEdit_theme_icon_minus:
  648. .. rst-class:: classref-themeproperty
  649. :ref:`Texture2D<class_Texture2D>` **minus**
  650. The icon for the zoom out button.
  651. .. rst-class:: classref-item-separator
  652. ----
  653. .. _class_GraphEdit_theme_icon_more:
  654. .. rst-class:: classref-themeproperty
  655. :ref:`Texture2D<class_Texture2D>` **more**
  656. The icon for the zoom in button.
  657. .. rst-class:: classref-item-separator
  658. ----
  659. .. _class_GraphEdit_theme_icon_reset:
  660. .. rst-class:: classref-themeproperty
  661. :ref:`Texture2D<class_Texture2D>` **reset**
  662. The icon for the zoom reset button.
  663. .. rst-class:: classref-item-separator
  664. ----
  665. .. _class_GraphEdit_theme_icon_snap:
  666. .. rst-class:: classref-themeproperty
  667. :ref:`Texture2D<class_Texture2D>` **snap**
  668. The icon for the snap toggle button.
  669. .. rst-class:: classref-item-separator
  670. ----
  671. .. _class_GraphEdit_theme_style_bg:
  672. .. rst-class:: classref-themeproperty
  673. :ref:`StyleBox<class_StyleBox>` **bg**
  674. The background drawn under the grid.
  675. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  676. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  677. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  678. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  679. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  680. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`