class_graphedit.rst 60 KB

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