class_graphedit.rst 92 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702
  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. **Experimental:** This class may be changed or removed in future versions.
  10. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  11. An editor for graph-like structures, using :ref:`GraphNode<class_GraphNode>`\ s.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  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>` represents 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 delete 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. \ **Note:** Keep in mind that :ref:`Node.get_children()<class_Node_method_get_children>` will also return the connection layer node named ``_connection_layer`` due to technical limitations. This behavior may change in future releases.
  19. .. rst-class:: classref-reftable-group
  20. Properties
  21. ----------
  22. .. table::
  23. :widths: auto
  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>` | ``4.0`` |
  32. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  33. | :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] | :ref:`connections<class_GraphEdit_property_connections>` | ``[]`` |
  34. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  35. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  36. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  37. | :ref:`GridPattern<enum_GraphEdit_GridPattern>` | :ref:`grid_pattern<class_GraphEdit_property_grid_pattern>` | ``0`` |
  38. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`minimap_enabled<class_GraphEdit_property_minimap_enabled>` | ``true`` |
  40. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`minimap_opacity<class_GraphEdit_property_minimap_opacity>` | ``0.65`` |
  42. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  43. | :ref:`Vector2<class_Vector2>` | :ref:`minimap_size<class_GraphEdit_property_minimap_size>` | ``Vector2(240, 160)`` |
  44. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  45. | :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` | :ref:`panning_scheme<class_GraphEdit_property_panning_scheme>` | ``0`` |
  46. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`right_disconnects<class_GraphEdit_property_right_disconnects>` | ``false`` |
  48. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  49. | :ref:`Vector2<class_Vector2>` | :ref:`scroll_offset<class_GraphEdit_property_scroll_offset>` | ``Vector2(0, 0)`` |
  50. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`show_arrange_button<class_GraphEdit_property_show_arrange_button>` | ``true`` |
  52. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  53. | :ref:`bool<class_bool>` | :ref:`show_grid<class_GraphEdit_property_show_grid>` | ``true`` |
  54. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`show_grid_buttons<class_GraphEdit_property_show_grid_buttons>` | ``true`` |
  56. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`show_menu<class_GraphEdit_property_show_menu>` | ``true`` |
  58. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`show_minimap_button<class_GraphEdit_property_show_minimap_button>` | ``true`` |
  60. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`show_zoom_buttons<class_GraphEdit_property_show_zoom_buttons>` | ``true`` |
  62. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  63. | :ref:`bool<class_bool>` | :ref:`show_zoom_label<class_GraphEdit_property_show_zoom_label>` | ``false`` |
  64. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`snapping_distance<class_GraphEdit_property_snapping_distance>` | ``20`` |
  66. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  67. | :ref:`bool<class_bool>` | :ref:`snapping_enabled<class_GraphEdit_property_snapping_enabled>` | ``true`` |
  68. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  69. | :ref:`Dictionary<class_Dictionary>` | :ref:`type_names<class_GraphEdit_property_type_names>` | ``{}`` |
  70. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  71. | :ref:`float<class_float>` | :ref:`zoom<class_GraphEdit_property_zoom>` | ``1.0`` |
  72. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  73. | :ref:`float<class_float>` | :ref:`zoom_max<class_GraphEdit_property_zoom_max>` | ``2.0736003`` |
  74. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  75. | :ref:`float<class_float>` | :ref:`zoom_min<class_GraphEdit_property_zoom_min>` | ``0.23256795`` |
  76. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  77. | :ref:`float<class_float>` | :ref:`zoom_step<class_GraphEdit_property_zoom_step>` | ``1.2`` |
  78. +------------------------------------------------------------------+--------------------------------------------------------------------------------------------+---------------------------------------------------------------------------+
  79. .. rst-class:: classref-reftable-group
  80. Methods
  81. -------
  82. .. table::
  83. :widths: auto
  84. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`_get_connection_line<class_GraphEdit_private_method__get_connection_line>`\ (\ from_position\: :ref:`Vector2<class_Vector2>`, to_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| |
  86. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`_is_in_input_hotzone<class_GraphEdit_private_method__is_in_input_hotzone>`\ (\ in_node\: :ref:`Object<class_Object>`, in_port\: :ref:`int<class_int>`, mouse_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |
  88. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`_is_in_output_hotzone<class_GraphEdit_private_method__is_in_output_hotzone>`\ (\ in_node\: :ref:`Object<class_Object>`, in_port\: :ref:`int<class_int>`, mouse_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |
  90. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`bool<class_bool>` | :ref:`_is_node_hover_valid<class_GraphEdit_private_method__is_node_hover_valid>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) |virtual| |
  92. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |void| | :ref:`add_valid_connection_type<class_GraphEdit_method_add_valid_connection_type>`\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) |
  94. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`add_valid_left_disconnect_type<class_GraphEdit_method_add_valid_left_disconnect_type>`\ (\ type\: :ref:`int<class_int>`\ ) |
  96. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | |void| | :ref:`add_valid_right_disconnect_type<class_GraphEdit_method_add_valid_right_disconnect_type>`\ (\ type\: :ref:`int<class_int>`\ ) |
  98. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`arrange_nodes<class_GraphEdit_method_arrange_nodes>`\ (\ ) |
  100. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |void| | :ref:`attach_graph_element_to_frame<class_GraphEdit_method_attach_graph_element_to_frame>`\ (\ element\: :ref:`StringName<class_StringName>`, frame\: :ref:`StringName<class_StringName>`\ ) |
  102. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | |void| | :ref:`clear_connections<class_GraphEdit_method_clear_connections>`\ (\ ) |
  104. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`connect_node<class_GraphEdit_method_connect_node>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`, keep_alive\: :ref:`bool<class_bool>` = false\ ) |
  106. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | |void| | :ref:`detach_graph_element_from_frame<class_GraphEdit_method_detach_graph_element_from_frame>`\ (\ element\: :ref:`StringName<class_StringName>`\ ) |
  108. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | |void| | :ref:`disconnect_node<class_GraphEdit_method_disconnect_node>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) |
  110. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | |void| | :ref:`force_connection_drag_end<class_GraphEdit_method_force_connection_drag_end>`\ (\ ) |
  112. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] | :ref:`get_attached_nodes_of_frame<class_GraphEdit_method_get_attached_nodes_of_frame>`\ (\ frame\: :ref:`StringName<class_StringName>`\ ) |
  114. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_closest_connection_at_point<class_GraphEdit_method_get_closest_connection_at_point>`\ (\ point\: :ref:`Vector2<class_Vector2>`, max_distance\: :ref:`float<class_float>` = 4.0\ ) |const| |
  116. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | :ref:`int<class_int>` | :ref:`get_connection_count<class_GraphEdit_method_get_connection_count>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`\ ) |
  118. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`PackedVector2Array<class_PackedVector2Array>` | :ref:`get_connection_line<class_GraphEdit_method_get_connection_line>`\ (\ from_node\: :ref:`Vector2<class_Vector2>`, to_node\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  120. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] | :ref:`get_connection_list_from_node<class_GraphEdit_method_get_connection_list_from_node>`\ (\ node\: :ref:`StringName<class_StringName>`\ ) |const| |
  122. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] | :ref:`get_connections_intersecting_with_rect<class_GraphEdit_method_get_connections_intersecting_with_rect>`\ (\ rect\: :ref:`Rect2<class_Rect2>`\ ) |const| |
  124. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | :ref:`GraphFrame<class_GraphFrame>` | :ref:`get_element_frame<class_GraphEdit_method_get_element_frame>`\ (\ element\: :ref:`StringName<class_StringName>`\ ) |
  126. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`HBoxContainer<class_HBoxContainer>` | :ref:`get_menu_hbox<class_GraphEdit_method_get_menu_hbox>`\ (\ ) |
  128. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | :ref:`bool<class_bool>` | :ref:`is_node_connected<class_GraphEdit_method_is_node_connected>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) |
  130. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`bool<class_bool>` | :ref:`is_valid_connection_type<class_GraphEdit_method_is_valid_connection_type>`\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) |const| |
  132. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | |void| | :ref:`remove_valid_connection_type<class_GraphEdit_method_remove_valid_connection_type>`\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) |
  134. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | |void| | :ref:`remove_valid_left_disconnect_type<class_GraphEdit_method_remove_valid_left_disconnect_type>`\ (\ type\: :ref:`int<class_int>`\ ) |
  136. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | |void| | :ref:`remove_valid_right_disconnect_type<class_GraphEdit_method_remove_valid_right_disconnect_type>`\ (\ type\: :ref:`int<class_int>`\ ) |
  138. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | |void| | :ref:`set_connection_activity<class_GraphEdit_method_set_connection_activity>`\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`, amount\: :ref:`float<class_float>`\ ) |
  140. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | |void| | :ref:`set_selected<class_GraphEdit_method_set_selected>`\ (\ node\: :ref:`Node<class_Node>`\ ) |
  142. +------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. .. rst-class:: classref-reftable-group
  144. Theme Properties
  145. ----------------
  146. .. table::
  147. :widths: auto
  148. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  149. | :ref:`Color<class_Color>` | :ref:`activity<class_GraphEdit_theme_color_activity>` | ``Color(1, 1, 1, 1)`` |
  150. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  151. | :ref:`Color<class_Color>` | :ref:`connection_hover_tint_color<class_GraphEdit_theme_color_connection_hover_tint_color>` | ``Color(0, 0, 0, 0.3)`` |
  152. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  153. | :ref:`Color<class_Color>` | :ref:`connection_rim_color<class_GraphEdit_theme_color_connection_rim_color>` | ``Color(0.1, 0.1, 0.1, 0.6)`` |
  154. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  155. | :ref:`Color<class_Color>` | :ref:`connection_valid_target_tint_color<class_GraphEdit_theme_color_connection_valid_target_tint_color>` | ``Color(1, 1, 1, 0.4)`` |
  156. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  157. | :ref:`Color<class_Color>` | :ref:`grid_major<class_GraphEdit_theme_color_grid_major>` | ``Color(1, 1, 1, 0.2)`` |
  158. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  159. | :ref:`Color<class_Color>` | :ref:`grid_minor<class_GraphEdit_theme_color_grid_minor>` | ``Color(1, 1, 1, 0.05)`` |
  160. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  161. | :ref:`Color<class_Color>` | :ref:`selection_fill<class_GraphEdit_theme_color_selection_fill>` | ``Color(1, 1, 1, 0.3)`` |
  162. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  163. | :ref:`Color<class_Color>` | :ref:`selection_stroke<class_GraphEdit_theme_color_selection_stroke>` | ``Color(1, 1, 1, 0.8)`` |
  164. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  165. | :ref:`int<class_int>` | :ref:`connection_hover_thickness<class_GraphEdit_theme_constant_connection_hover_thickness>` | ``0`` |
  166. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  167. | :ref:`int<class_int>` | :ref:`port_hotzone_inner_extent<class_GraphEdit_theme_constant_port_hotzone_inner_extent>` | ``22`` |
  168. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  169. | :ref:`int<class_int>` | :ref:`port_hotzone_outer_extent<class_GraphEdit_theme_constant_port_hotzone_outer_extent>` | ``26`` |
  170. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  171. | :ref:`Texture2D<class_Texture2D>` | :ref:`grid_toggle<class_GraphEdit_theme_icon_grid_toggle>` | |
  172. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  173. | :ref:`Texture2D<class_Texture2D>` | :ref:`layout<class_GraphEdit_theme_icon_layout>` | |
  174. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  175. | :ref:`Texture2D<class_Texture2D>` | :ref:`minimap_toggle<class_GraphEdit_theme_icon_minimap_toggle>` | |
  176. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  177. | :ref:`Texture2D<class_Texture2D>` | :ref:`snapping_toggle<class_GraphEdit_theme_icon_snapping_toggle>` | |
  178. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  179. | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_in<class_GraphEdit_theme_icon_zoom_in>` | |
  180. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  181. | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_out<class_GraphEdit_theme_icon_zoom_out>` | |
  182. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  183. | :ref:`Texture2D<class_Texture2D>` | :ref:`zoom_reset<class_GraphEdit_theme_icon_zoom_reset>` | |
  184. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  185. | :ref:`StyleBox<class_StyleBox>` | :ref:`menu_panel<class_GraphEdit_theme_style_menu_panel>` | |
  186. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  187. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_GraphEdit_theme_style_panel>` | |
  188. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  189. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel_focus<class_GraphEdit_theme_style_panel_focus>` | |
  190. +-----------------------------------+-----------------------------------------------------------------------------------------------------------+-------------------------------+
  191. .. rst-class:: classref-section-separator
  192. ----
  193. .. rst-class:: classref-descriptions-group
  194. Signals
  195. -------
  196. .. _class_GraphEdit_signal_begin_node_move:
  197. .. rst-class:: classref-signal
  198. **begin_node_move**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_begin_node_move>`
  199. Emitted at the beginning of a :ref:`GraphElement<class_GraphElement>`'s movement.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_GraphEdit_signal_connection_drag_ended:
  203. .. rst-class:: classref-signal
  204. **connection_drag_ended**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_connection_drag_ended>`
  205. Emitted at the end of a connection drag.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_GraphEdit_signal_connection_drag_started:
  209. .. rst-class:: classref-signal
  210. **connection_drag_started**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, is_output\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_connection_drag_started>`
  211. Emitted at the beginning of a connection drag.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_GraphEdit_signal_connection_from_empty:
  215. .. rst-class:: classref-signal
  216. **connection_from_empty**\ (\ to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`, release_position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_connection_from_empty>`
  217. Emitted when user drags a connection from an input port into the empty space of the graph.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_GraphEdit_signal_connection_request:
  221. .. rst-class:: classref-signal
  222. **connection_request**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_connection_request>`
  223. 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.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_GraphEdit_signal_connection_to_empty:
  227. .. rst-class:: classref-signal
  228. **connection_to_empty**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, release_position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_connection_to_empty>`
  229. Emitted when user drags a connection from an output port into the empty space of the graph.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_GraphEdit_signal_copy_nodes_request:
  233. .. rst-class:: classref-signal
  234. **copy_nodes_request**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_copy_nodes_request>`
  235. Emitted when this **GraphEdit** captures a ``ui_copy`` action (:kbd:`Ctrl + C` by default). In general, this signal indicates that the selected :ref:`GraphElement<class_GraphElement>`\ s should be copied.
  236. .. rst-class:: classref-item-separator
  237. ----
  238. .. _class_GraphEdit_signal_cut_nodes_request:
  239. .. rst-class:: classref-signal
  240. **cut_nodes_request**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_cut_nodes_request>`
  241. Emitted when this **GraphEdit** captures a ``ui_cut`` action (:kbd:`Ctrl + X` by default). In general, this signal indicates that the selected :ref:`GraphElement<class_GraphElement>`\ s should be cut.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_GraphEdit_signal_delete_nodes_request:
  245. .. rst-class:: classref-signal
  246. **delete_nodes_request**\ (\ nodes\: :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\]\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_delete_nodes_request>`
  247. Emitted when this **GraphEdit** captures a ``ui_graph_delete`` action (:kbd:`Delete` by default).
  248. \ ``nodes`` is an array of node names that should be removed. These usually include all selected nodes.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_GraphEdit_signal_disconnection_request:
  252. .. rst-class:: classref-signal
  253. **disconnection_request**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_disconnection_request>`
  254. 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.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_GraphEdit_signal_duplicate_nodes_request:
  258. .. rst-class:: classref-signal
  259. **duplicate_nodes_request**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_duplicate_nodes_request>`
  260. Emitted when this **GraphEdit** captures a ``ui_graph_duplicate`` action (:kbd:`Ctrl + D` by default). In general, this signal indicates that the selected :ref:`GraphElement<class_GraphElement>`\ s should be duplicated.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_GraphEdit_signal_end_node_move:
  264. .. rst-class:: classref-signal
  265. **end_node_move**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_end_node_move>`
  266. Emitted at the end of a :ref:`GraphElement<class_GraphElement>`'s movement.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_GraphEdit_signal_frame_rect_changed:
  270. .. rst-class:: classref-signal
  271. **frame_rect_changed**\ (\ frame\: :ref:`GraphFrame<class_GraphFrame>`, new_rect\: :ref:`Rect2<class_Rect2>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_frame_rect_changed>`
  272. Emitted when the :ref:`GraphFrame<class_GraphFrame>` ``frame`` is resized to ``new_rect``.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_GraphEdit_signal_graph_elements_linked_to_frame_request:
  276. .. rst-class:: classref-signal
  277. **graph_elements_linked_to_frame_request**\ (\ elements\: :ref:`Array<class_Array>`, frame\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_graph_elements_linked_to_frame_request>`
  278. Emitted when one or more :ref:`GraphElement<class_GraphElement>`\ s are dropped onto the :ref:`GraphFrame<class_GraphFrame>` named ``frame``, when they were not previously attached to any other one.
  279. \ ``elements`` is an array of :ref:`GraphElement<class_GraphElement>`\ s to be attached.
  280. .. rst-class:: classref-item-separator
  281. ----
  282. .. _class_GraphEdit_signal_node_deselected:
  283. .. rst-class:: classref-signal
  284. **node_deselected**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_node_deselected>`
  285. Emitted when the given :ref:`GraphElement<class_GraphElement>` node is deselected.
  286. .. rst-class:: classref-item-separator
  287. ----
  288. .. _class_GraphEdit_signal_node_selected:
  289. .. rst-class:: classref-signal
  290. **node_selected**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_node_selected>`
  291. Emitted when the given :ref:`GraphElement<class_GraphElement>` node is selected.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_GraphEdit_signal_paste_nodes_request:
  295. .. rst-class:: classref-signal
  296. **paste_nodes_request**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_paste_nodes_request>`
  297. Emitted when this **GraphEdit** captures a ``ui_paste`` action (:kbd:`Ctrl + V` by default). In general, this signal indicates that previously copied :ref:`GraphElement<class_GraphElement>`\ s should be pasted.
  298. .. rst-class:: classref-item-separator
  299. ----
  300. .. _class_GraphEdit_signal_popup_request:
  301. .. rst-class:: classref-signal
  302. **popup_request**\ (\ at_position\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_popup_request>`
  303. Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. ``at_position`` is the position of the mouse pointer when the signal is sent.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_GraphEdit_signal_scroll_offset_changed:
  307. .. rst-class:: classref-signal
  308. **scroll_offset_changed**\ (\ offset\: :ref:`Vector2<class_Vector2>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_signal_scroll_offset_changed>`
  309. Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code.
  310. .. rst-class:: classref-section-separator
  311. ----
  312. .. rst-class:: classref-descriptions-group
  313. Enumerations
  314. ------------
  315. .. _enum_GraphEdit_PanningScheme:
  316. .. rst-class:: classref-enumeration
  317. enum **PanningScheme**: :ref:`๐Ÿ”—<enum_GraphEdit_PanningScheme>`
  318. .. _class_GraphEdit_constant_SCROLL_ZOOMS:
  319. .. rst-class:: classref-enumeration-constant
  320. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_ZOOMS** = ``0``
  321. :kbd:`Mouse Wheel` will zoom, :kbd:`Ctrl + Mouse Wheel` will move the view.
  322. .. _class_GraphEdit_constant_SCROLL_PANS:
  323. .. rst-class:: classref-enumeration-constant
  324. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **SCROLL_PANS** = ``1``
  325. :kbd:`Mouse Wheel` will move the view, :kbd:`Ctrl + Mouse Wheel` will zoom.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _enum_GraphEdit_GridPattern:
  329. .. rst-class:: classref-enumeration
  330. enum **GridPattern**: :ref:`๐Ÿ”—<enum_GraphEdit_GridPattern>`
  331. .. _class_GraphEdit_constant_GRID_PATTERN_LINES:
  332. .. rst-class:: classref-enumeration-constant
  333. :ref:`GridPattern<enum_GraphEdit_GridPattern>` **GRID_PATTERN_LINES** = ``0``
  334. Draw the grid using solid lines.
  335. .. _class_GraphEdit_constant_GRID_PATTERN_DOTS:
  336. .. rst-class:: classref-enumeration-constant
  337. :ref:`GridPattern<enum_GraphEdit_GridPattern>` **GRID_PATTERN_DOTS** = ``1``
  338. Draw the grid using dots.
  339. .. rst-class:: classref-section-separator
  340. ----
  341. .. rst-class:: classref-descriptions-group
  342. Property Descriptions
  343. ---------------------
  344. .. _class_GraphEdit_property_connection_lines_antialiased:
  345. .. rst-class:: classref-property
  346. :ref:`bool<class_bool>` **connection_lines_antialiased** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_connection_lines_antialiased>`
  347. .. rst-class:: classref-property-setget
  348. - |void| **set_connection_lines_antialiased**\ (\ value\: :ref:`bool<class_bool>`\ )
  349. - :ref:`bool<class_bool>` **is_connection_lines_antialiased**\ (\ )
  350. If ``true``, the lines between nodes will use antialiasing.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_GraphEdit_property_connection_lines_curvature:
  354. .. rst-class:: classref-property
  355. :ref:`float<class_float>` **connection_lines_curvature** = ``0.5`` :ref:`๐Ÿ”—<class_GraphEdit_property_connection_lines_curvature>`
  356. .. rst-class:: classref-property-setget
  357. - |void| **set_connection_lines_curvature**\ (\ value\: :ref:`float<class_float>`\ )
  358. - :ref:`float<class_float>` **get_connection_lines_curvature**\ (\ )
  359. The curvature of the lines between the nodes. 0 results in straight lines.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_GraphEdit_property_connection_lines_thickness:
  363. .. rst-class:: classref-property
  364. :ref:`float<class_float>` **connection_lines_thickness** = ``4.0`` :ref:`๐Ÿ”—<class_GraphEdit_property_connection_lines_thickness>`
  365. .. rst-class:: classref-property-setget
  366. - |void| **set_connection_lines_thickness**\ (\ value\: :ref:`float<class_float>`\ )
  367. - :ref:`float<class_float>` **get_connection_lines_thickness**\ (\ )
  368. The thickness of the lines between the nodes.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_GraphEdit_property_connections:
  372. .. rst-class:: classref-property
  373. :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] **connections** = ``[]`` :ref:`๐Ÿ”—<class_GraphEdit_property_connections>`
  374. .. rst-class:: classref-property-setget
  375. - |void| **set_connections**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\]\ )
  376. - :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] **get_connection_list**\ (\ )
  377. The connections between :ref:`GraphNode<class_GraphNode>`\ s.
  378. A connection is represented as a :ref:`Dictionary<class_Dictionary>` in the form of:
  379. ::
  380. {
  381. from_node: StringName,
  382. from_port: int,
  383. to_node: StringName,
  384. to_port: int,
  385. keep_alive: bool
  386. }
  387. Connections with ``keep_alive`` set to ``false`` may be deleted automatically if invalid during a redraw.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_GraphEdit_property_grid_pattern:
  391. .. rst-class:: classref-property
  392. :ref:`GridPattern<enum_GraphEdit_GridPattern>` **grid_pattern** = ``0`` :ref:`๐Ÿ”—<class_GraphEdit_property_grid_pattern>`
  393. .. rst-class:: classref-property-setget
  394. - |void| **set_grid_pattern**\ (\ value\: :ref:`GridPattern<enum_GraphEdit_GridPattern>`\ )
  395. - :ref:`GridPattern<enum_GraphEdit_GridPattern>` **get_grid_pattern**\ (\ )
  396. The pattern used for drawing the grid.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_GraphEdit_property_minimap_enabled:
  400. .. rst-class:: classref-property
  401. :ref:`bool<class_bool>` **minimap_enabled** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_minimap_enabled>`
  402. .. rst-class:: classref-property-setget
  403. - |void| **set_minimap_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  404. - :ref:`bool<class_bool>` **is_minimap_enabled**\ (\ )
  405. If ``true``, the minimap is visible.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_GraphEdit_property_minimap_opacity:
  409. .. rst-class:: classref-property
  410. :ref:`float<class_float>` **minimap_opacity** = ``0.65`` :ref:`๐Ÿ”—<class_GraphEdit_property_minimap_opacity>`
  411. .. rst-class:: classref-property-setget
  412. - |void| **set_minimap_opacity**\ (\ value\: :ref:`float<class_float>`\ )
  413. - :ref:`float<class_float>` **get_minimap_opacity**\ (\ )
  414. The opacity of the minimap rectangle.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_GraphEdit_property_minimap_size:
  418. .. rst-class:: classref-property
  419. :ref:`Vector2<class_Vector2>` **minimap_size** = ``Vector2(240, 160)`` :ref:`๐Ÿ”—<class_GraphEdit_property_minimap_size>`
  420. .. rst-class:: classref-property-setget
  421. - |void| **set_minimap_size**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  422. - :ref:`Vector2<class_Vector2>` **get_minimap_size**\ (\ )
  423. 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.
  424. .. rst-class:: classref-item-separator
  425. ----
  426. .. _class_GraphEdit_property_panning_scheme:
  427. .. rst-class:: classref-property
  428. :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **panning_scheme** = ``0`` :ref:`๐Ÿ”—<class_GraphEdit_property_panning_scheme>`
  429. .. rst-class:: classref-property-setget
  430. - |void| **set_panning_scheme**\ (\ value\: :ref:`PanningScheme<enum_GraphEdit_PanningScheme>`\ )
  431. - :ref:`PanningScheme<enum_GraphEdit_PanningScheme>` **get_panning_scheme**\ (\ )
  432. Defines the control scheme for panning with mouse wheel.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_GraphEdit_property_right_disconnects:
  436. .. rst-class:: classref-property
  437. :ref:`bool<class_bool>` **right_disconnects** = ``false`` :ref:`๐Ÿ”—<class_GraphEdit_property_right_disconnects>`
  438. .. rst-class:: classref-property-setget
  439. - |void| **set_right_disconnects**\ (\ value\: :ref:`bool<class_bool>`\ )
  440. - :ref:`bool<class_bool>` **is_right_disconnects_enabled**\ (\ )
  441. If ``true``, enables disconnection of existing connections in the GraphEdit by dragging the right end.
  442. .. rst-class:: classref-item-separator
  443. ----
  444. .. _class_GraphEdit_property_scroll_offset:
  445. .. rst-class:: classref-property
  446. :ref:`Vector2<class_Vector2>` **scroll_offset** = ``Vector2(0, 0)`` :ref:`๐Ÿ”—<class_GraphEdit_property_scroll_offset>`
  447. .. rst-class:: classref-property-setget
  448. - |void| **set_scroll_offset**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
  449. - :ref:`Vector2<class_Vector2>` **get_scroll_offset**\ (\ )
  450. The scroll offset.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_GraphEdit_property_show_arrange_button:
  454. .. rst-class:: classref-property
  455. :ref:`bool<class_bool>` **show_arrange_button** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_arrange_button>`
  456. .. rst-class:: classref-property-setget
  457. - |void| **set_show_arrange_button**\ (\ value\: :ref:`bool<class_bool>`\ )
  458. - :ref:`bool<class_bool>` **is_showing_arrange_button**\ (\ )
  459. If ``true``, the button to automatically arrange graph nodes is visible.
  460. .. rst-class:: classref-item-separator
  461. ----
  462. .. _class_GraphEdit_property_show_grid:
  463. .. rst-class:: classref-property
  464. :ref:`bool<class_bool>` **show_grid** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_grid>`
  465. .. rst-class:: classref-property-setget
  466. - |void| **set_show_grid**\ (\ value\: :ref:`bool<class_bool>`\ )
  467. - :ref:`bool<class_bool>` **is_showing_grid**\ (\ )
  468. If ``true``, the grid is visible.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_GraphEdit_property_show_grid_buttons:
  472. .. rst-class:: classref-property
  473. :ref:`bool<class_bool>` **show_grid_buttons** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_grid_buttons>`
  474. .. rst-class:: classref-property-setget
  475. - |void| **set_show_grid_buttons**\ (\ value\: :ref:`bool<class_bool>`\ )
  476. - :ref:`bool<class_bool>` **is_showing_grid_buttons**\ (\ )
  477. If ``true``, buttons that allow to configure grid and snapping options are visible.
  478. .. rst-class:: classref-item-separator
  479. ----
  480. .. _class_GraphEdit_property_show_menu:
  481. .. rst-class:: classref-property
  482. :ref:`bool<class_bool>` **show_menu** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_menu>`
  483. .. rst-class:: classref-property-setget
  484. - |void| **set_show_menu**\ (\ value\: :ref:`bool<class_bool>`\ )
  485. - :ref:`bool<class_bool>` **is_showing_menu**\ (\ )
  486. If ``true``, the menu toolbar is visible.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_GraphEdit_property_show_minimap_button:
  490. .. rst-class:: classref-property
  491. :ref:`bool<class_bool>` **show_minimap_button** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_minimap_button>`
  492. .. rst-class:: classref-property-setget
  493. - |void| **set_show_minimap_button**\ (\ value\: :ref:`bool<class_bool>`\ )
  494. - :ref:`bool<class_bool>` **is_showing_minimap_button**\ (\ )
  495. If ``true``, the button to toggle the minimap is visible.
  496. .. rst-class:: classref-item-separator
  497. ----
  498. .. _class_GraphEdit_property_show_zoom_buttons:
  499. .. rst-class:: classref-property
  500. :ref:`bool<class_bool>` **show_zoom_buttons** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_zoom_buttons>`
  501. .. rst-class:: classref-property-setget
  502. - |void| **set_show_zoom_buttons**\ (\ value\: :ref:`bool<class_bool>`\ )
  503. - :ref:`bool<class_bool>` **is_showing_zoom_buttons**\ (\ )
  504. If ``true``, buttons that allow to change and reset the zoom level are visible.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_GraphEdit_property_show_zoom_label:
  508. .. rst-class:: classref-property
  509. :ref:`bool<class_bool>` **show_zoom_label** = ``false`` :ref:`๐Ÿ”—<class_GraphEdit_property_show_zoom_label>`
  510. .. rst-class:: classref-property-setget
  511. - |void| **set_show_zoom_label**\ (\ value\: :ref:`bool<class_bool>`\ )
  512. - :ref:`bool<class_bool>` **is_showing_zoom_label**\ (\ )
  513. If ``true``, the label with the current zoom level is visible. The zoom level is displayed in percents.
  514. .. rst-class:: classref-item-separator
  515. ----
  516. .. _class_GraphEdit_property_snapping_distance:
  517. .. rst-class:: classref-property
  518. :ref:`int<class_int>` **snapping_distance** = ``20`` :ref:`๐Ÿ”—<class_GraphEdit_property_snapping_distance>`
  519. .. rst-class:: classref-property-setget
  520. - |void| **set_snapping_distance**\ (\ value\: :ref:`int<class_int>`\ )
  521. - :ref:`int<class_int>` **get_snapping_distance**\ (\ )
  522. The snapping distance in pixels, also determines the grid line distance.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_GraphEdit_property_snapping_enabled:
  526. .. rst-class:: classref-property
  527. :ref:`bool<class_bool>` **snapping_enabled** = ``true`` :ref:`๐Ÿ”—<class_GraphEdit_property_snapping_enabled>`
  528. .. rst-class:: classref-property-setget
  529. - |void| **set_snapping_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  530. - :ref:`bool<class_bool>` **is_snapping_enabled**\ (\ )
  531. If ``true``, enables snapping.
  532. .. rst-class:: classref-item-separator
  533. ----
  534. .. _class_GraphEdit_property_type_names:
  535. .. rst-class:: classref-property
  536. :ref:`Dictionary<class_Dictionary>` **type_names** = ``{}`` :ref:`๐Ÿ”—<class_GraphEdit_property_type_names>`
  537. .. rst-class:: classref-property-setget
  538. - |void| **set_type_names**\ (\ value\: :ref:`Dictionary<class_Dictionary>`\ )
  539. - :ref:`Dictionary<class_Dictionary>` **get_type_names**\ (\ )
  540. :ref:`Dictionary<class_Dictionary>` of human readable port type names.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_GraphEdit_property_zoom:
  544. .. rst-class:: classref-property
  545. :ref:`float<class_float>` **zoom** = ``1.0`` :ref:`๐Ÿ”—<class_GraphEdit_property_zoom>`
  546. .. rst-class:: classref-property-setget
  547. - |void| **set_zoom**\ (\ value\: :ref:`float<class_float>`\ )
  548. - :ref:`float<class_float>` **get_zoom**\ (\ )
  549. The current zoom value.
  550. .. rst-class:: classref-item-separator
  551. ----
  552. .. _class_GraphEdit_property_zoom_max:
  553. .. rst-class:: classref-property
  554. :ref:`float<class_float>` **zoom_max** = ``2.0736003`` :ref:`๐Ÿ”—<class_GraphEdit_property_zoom_max>`
  555. .. rst-class:: classref-property-setget
  556. - |void| **set_zoom_max**\ (\ value\: :ref:`float<class_float>`\ )
  557. - :ref:`float<class_float>` **get_zoom_max**\ (\ )
  558. The upper zoom limit.
  559. .. rst-class:: classref-item-separator
  560. ----
  561. .. _class_GraphEdit_property_zoom_min:
  562. .. rst-class:: classref-property
  563. :ref:`float<class_float>` **zoom_min** = ``0.23256795`` :ref:`๐Ÿ”—<class_GraphEdit_property_zoom_min>`
  564. .. rst-class:: classref-property-setget
  565. - |void| **set_zoom_min**\ (\ value\: :ref:`float<class_float>`\ )
  566. - :ref:`float<class_float>` **get_zoom_min**\ (\ )
  567. The lower zoom limit.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_GraphEdit_property_zoom_step:
  571. .. rst-class:: classref-property
  572. :ref:`float<class_float>` **zoom_step** = ``1.2`` :ref:`๐Ÿ”—<class_GraphEdit_property_zoom_step>`
  573. .. rst-class:: classref-property-setget
  574. - |void| **set_zoom_step**\ (\ value\: :ref:`float<class_float>`\ )
  575. - :ref:`float<class_float>` **get_zoom_step**\ (\ )
  576. The step of each zoom level.
  577. .. rst-class:: classref-section-separator
  578. ----
  579. .. rst-class:: classref-descriptions-group
  580. Method Descriptions
  581. -------------------
  582. .. _class_GraphEdit_private_method__get_connection_line:
  583. .. rst-class:: classref-method
  584. :ref:`PackedVector2Array<class_PackedVector2Array>` **_get_connection_line**\ (\ from_position\: :ref:`Vector2<class_Vector2>`, to_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| |const| :ref:`๐Ÿ”—<class_GraphEdit_private_method__get_connection_line>`
  585. Virtual method which can be overridden to customize how connections are drawn.
  586. .. rst-class:: classref-item-separator
  587. ----
  588. .. _class_GraphEdit_private_method__is_in_input_hotzone:
  589. .. rst-class:: classref-method
  590. :ref:`bool<class_bool>` **_is_in_input_hotzone**\ (\ in_node\: :ref:`Object<class_Object>`, in_port\: :ref:`int<class_int>`, mouse_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| :ref:`๐Ÿ”—<class_GraphEdit_private_method__is_in_input_hotzone>`
  591. Returns whether the ``mouse_position`` is in the input hot zone.
  592. By default, a hot zone is a :ref:`Rect2<class_Rect2>` positioned such that its center is at ``in_node``.\ :ref:`GraphNode.get_input_port_position()<class_GraphNode_method_get_input_port_position>`\ (``in_port``) (For output's case, call :ref:`GraphNode.get_output_port_position()<class_GraphNode_method_get_output_port_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``.
  593. Below is a sample code to help get started:
  594. ::
  595. func _is_in_input_hotzone(in_node, in_port, mouse_position):
  596. var port_size = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
  597. var port_pos = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
  598. var rect = Rect2(port_pos, port_size)
  599. return rect.has_point(mouse_position)
  600. .. rst-class:: classref-item-separator
  601. ----
  602. .. _class_GraphEdit_private_method__is_in_output_hotzone:
  603. .. rst-class:: classref-method
  604. :ref:`bool<class_bool>` **_is_in_output_hotzone**\ (\ in_node\: :ref:`Object<class_Object>`, in_port\: :ref:`int<class_int>`, mouse_position\: :ref:`Vector2<class_Vector2>`\ ) |virtual| :ref:`๐Ÿ”—<class_GraphEdit_private_method__is_in_output_hotzone>`
  605. 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_private_method__is_in_input_hotzone>`.
  606. Below is a sample code to help get started:
  607. ::
  608. func _is_in_output_hotzone(in_node, in_port, mouse_position):
  609. var port_size = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
  610. var port_pos = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
  611. var rect = Rect2(port_pos, port_size)
  612. return rect.has_point(mouse_position)
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_GraphEdit_private_method__is_node_hover_valid:
  616. .. rst-class:: classref-method
  617. :ref:`bool<class_bool>` **_is_node_hover_valid**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) |virtual| :ref:`๐Ÿ”—<class_GraphEdit_private_method__is_node_hover_valid>`
  618. This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port.
  619. 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.
  620. In this example a connection to same node is suppressed:
  621. .. tabs::
  622. .. code-tab:: gdscript
  623. func _is_node_hover_valid(from, from_port, to, to_port):
  624. return from != to
  625. .. code-tab:: csharp
  626. public override bool _IsNodeHoverValid(StringName fromNode, int fromPort, StringName toNode, int toPort)
  627. {
  628. return fromNode != toNode;
  629. }
  630. .. rst-class:: classref-item-separator
  631. ----
  632. .. _class_GraphEdit_method_add_valid_connection_type:
  633. .. rst-class:: classref-method
  634. |void| **add_valid_connection_type**\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_add_valid_connection_type>`
  635. 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.
  636. 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>`.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_GraphEdit_method_add_valid_left_disconnect_type:
  640. .. rst-class:: classref-method
  641. |void| **add_valid_left_disconnect_type**\ (\ type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_add_valid_left_disconnect_type>`
  642. 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>`.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_GraphEdit_method_add_valid_right_disconnect_type:
  646. .. rst-class:: classref-method
  647. |void| **add_valid_right_disconnect_type**\ (\ type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_add_valid_right_disconnect_type>`
  648. 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>`.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_GraphEdit_method_arrange_nodes:
  652. .. rst-class:: classref-method
  653. |void| **arrange_nodes**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_arrange_nodes>`
  654. Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_GraphEdit_method_attach_graph_element_to_frame:
  658. .. rst-class:: classref-method
  659. |void| **attach_graph_element_to_frame**\ (\ element\: :ref:`StringName<class_StringName>`, frame\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_attach_graph_element_to_frame>`
  660. Attaches the ``element`` :ref:`GraphElement<class_GraphElement>` to the ``frame`` :ref:`GraphFrame<class_GraphFrame>`.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_GraphEdit_method_clear_connections:
  664. .. rst-class:: classref-method
  665. |void| **clear_connections**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_clear_connections>`
  666. Removes all connections between nodes.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_GraphEdit_method_connect_node:
  670. .. rst-class:: classref-method
  671. :ref:`Error<enum_@GlobalScope_Error>` **connect_node**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`, keep_alive\: :ref:`bool<class_bool>` = false\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_connect_node>`
  672. 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.
  673. Connections with ``keep_alive`` set to ``false`` may be deleted automatically if invalid during a redraw.
  674. .. rst-class:: classref-item-separator
  675. ----
  676. .. _class_GraphEdit_method_detach_graph_element_from_frame:
  677. .. rst-class:: classref-method
  678. |void| **detach_graph_element_from_frame**\ (\ element\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_detach_graph_element_from_frame>`
  679. Detaches the ``element`` :ref:`GraphElement<class_GraphElement>` from the :ref:`GraphFrame<class_GraphFrame>` it is currently attached to.
  680. .. rst-class:: classref-item-separator
  681. ----
  682. .. _class_GraphEdit_method_disconnect_node:
  683. .. rst-class:: classref-method
  684. |void| **disconnect_node**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_disconnect_node>`
  685. 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.
  686. .. rst-class:: classref-item-separator
  687. ----
  688. .. _class_GraphEdit_method_force_connection_drag_end:
  689. .. rst-class:: classref-method
  690. |void| **force_connection_drag_end**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_force_connection_drag_end>`
  691. 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.
  692. 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.
  693. \ **Note:** This method suppresses any other connection request signals apart from :ref:`connection_drag_ended<class_GraphEdit_signal_connection_drag_ended>`.
  694. .. rst-class:: classref-item-separator
  695. ----
  696. .. _class_GraphEdit_method_get_attached_nodes_of_frame:
  697. .. rst-class:: classref-method
  698. :ref:`Array<class_Array>`\[:ref:`StringName<class_StringName>`\] **get_attached_nodes_of_frame**\ (\ frame\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_get_attached_nodes_of_frame>`
  699. Returns an array of node names that are attached to the :ref:`GraphFrame<class_GraphFrame>` with the given name.
  700. .. rst-class:: classref-item-separator
  701. ----
  702. .. _class_GraphEdit_method_get_closest_connection_at_point:
  703. .. rst-class:: classref-method
  704. :ref:`Dictionary<class_Dictionary>` **get_closest_connection_at_point**\ (\ point\: :ref:`Vector2<class_Vector2>`, max_distance\: :ref:`float<class_float>` = 4.0\ ) |const| :ref:`๐Ÿ”—<class_GraphEdit_method_get_closest_connection_at_point>`
  705. Returns the closest connection to the given point in screen space. If no connection is found within ``max_distance`` pixels, an empty :ref:`Dictionary<class_Dictionary>` is returned.
  706. A connection is represented as a :ref:`Dictionary<class_Dictionary>` in the form of:
  707. ::
  708. {
  709. from_node: StringName,
  710. from_port: int,
  711. to_node: StringName,
  712. to_port: int,
  713. keep_alive: bool
  714. }
  715. For example, getting a connection at a given mouse position can be achieved like this:
  716. .. tabs::
  717. .. code-tab:: gdscript
  718. var connection = get_closest_connection_at_point(mouse_event.get_position())
  719. .. rst-class:: classref-item-separator
  720. ----
  721. .. _class_GraphEdit_method_get_connection_count:
  722. .. rst-class:: classref-method
  723. :ref:`int<class_int>` **get_connection_count**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_get_connection_count>`
  724. Returns the number of connections from ``from_port`` of ``from_node``.
  725. .. rst-class:: classref-item-separator
  726. ----
  727. .. _class_GraphEdit_method_get_connection_line:
  728. .. rst-class:: classref-method
  729. :ref:`PackedVector2Array<class_PackedVector2Array>` **get_connection_line**\ (\ from_node\: :ref:`Vector2<class_Vector2>`, to_node\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_GraphEdit_method_get_connection_line>`
  730. Returns the points which would make up a connection between ``from_node`` and ``to_node``.
  731. .. rst-class:: classref-item-separator
  732. ----
  733. .. _class_GraphEdit_method_get_connection_list_from_node:
  734. .. rst-class:: classref-method
  735. :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] **get_connection_list_from_node**\ (\ node\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`๐Ÿ”—<class_GraphEdit_method_get_connection_list_from_node>`
  736. Returns an :ref:`Array<class_Array>` containing a list of all connections for ``node``.
  737. A connection is represented as a :ref:`Dictionary<class_Dictionary>` in the form of:
  738. ::
  739. {
  740. from_node: StringName,
  741. from_port: int,
  742. to_node: StringName,
  743. to_port: int,
  744. keep_alive: bool
  745. }
  746. \ **Example:** Get all connections on a specific port:
  747. ::
  748. func get_connection_list_from_port(node, port):
  749. var connections = get_connection_list_from_node(node)
  750. var result = []
  751. for connection in connections:
  752. var dict = {}
  753. if connection["from_node"] == node and connection["from_port"] == port:
  754. dict["node"] = connection["to_node"]
  755. dict["port"] = connection["to_port"]
  756. dict["type"] = "left"
  757. result.push_back(dict)
  758. elif connection["to_node"] == node and connection["to_port"] == port:
  759. dict["node"] = connection["from_node"]
  760. dict["port"] = connection["from_port"]
  761. dict["type"] = "right"
  762. result.push_back(dict)
  763. return result
  764. .. rst-class:: classref-item-separator
  765. ----
  766. .. _class_GraphEdit_method_get_connections_intersecting_with_rect:
  767. .. rst-class:: classref-method
  768. :ref:`Array<class_Array>`\[:ref:`Dictionary<class_Dictionary>`\] **get_connections_intersecting_with_rect**\ (\ rect\: :ref:`Rect2<class_Rect2>`\ ) |const| :ref:`๐Ÿ”—<class_GraphEdit_method_get_connections_intersecting_with_rect>`
  769. Returns an :ref:`Array<class_Array>` containing the list of connections that intersect with the given :ref:`Rect2<class_Rect2>`.
  770. A connection is represented as a :ref:`Dictionary<class_Dictionary>` in the form of:
  771. ::
  772. {
  773. from_node: StringName,
  774. from_port: int,
  775. to_node: StringName,
  776. to_port: int,
  777. keep_alive: bool
  778. }
  779. .. rst-class:: classref-item-separator
  780. ----
  781. .. _class_GraphEdit_method_get_element_frame:
  782. .. rst-class:: classref-method
  783. :ref:`GraphFrame<class_GraphFrame>` **get_element_frame**\ (\ element\: :ref:`StringName<class_StringName>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_get_element_frame>`
  784. Returns the :ref:`GraphFrame<class_GraphFrame>` that contains the :ref:`GraphElement<class_GraphElement>` with the given name.
  785. .. rst-class:: classref-item-separator
  786. ----
  787. .. _class_GraphEdit_method_get_menu_hbox:
  788. .. rst-class:: classref-method
  789. :ref:`HBoxContainer<class_HBoxContainer>` **get_menu_hbox**\ (\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_get_menu_hbox>`
  790. 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.
  791. \ **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.
  792. .. rst-class:: classref-item-separator
  793. ----
  794. .. _class_GraphEdit_method_is_node_connected:
  795. .. rst-class:: classref-method
  796. :ref:`bool<class_bool>` **is_node_connected**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_is_node_connected>`
  797. 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>`.
  798. .. rst-class:: classref-item-separator
  799. ----
  800. .. _class_GraphEdit_method_is_valid_connection_type:
  801. .. rst-class:: classref-method
  802. :ref:`bool<class_bool>` **is_valid_connection_type**\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_GraphEdit_method_is_valid_connection_type>`
  803. 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.
  804. 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>`.
  805. .. rst-class:: classref-item-separator
  806. ----
  807. .. _class_GraphEdit_method_remove_valid_connection_type:
  808. .. rst-class:: classref-method
  809. |void| **remove_valid_connection_type**\ (\ from_type\: :ref:`int<class_int>`, to_type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_remove_valid_connection_type>`
  810. 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.
  811. See also :ref:`is_valid_connection_type()<class_GraphEdit_method_is_valid_connection_type>`.
  812. .. rst-class:: classref-item-separator
  813. ----
  814. .. _class_GraphEdit_method_remove_valid_left_disconnect_type:
  815. .. rst-class:: classref-method
  816. |void| **remove_valid_left_disconnect_type**\ (\ type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_remove_valid_left_disconnect_type>`
  817. 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>`.
  818. .. rst-class:: classref-item-separator
  819. ----
  820. .. _class_GraphEdit_method_remove_valid_right_disconnect_type:
  821. .. rst-class:: classref-method
  822. |void| **remove_valid_right_disconnect_type**\ (\ type\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_remove_valid_right_disconnect_type>`
  823. 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>`.
  824. .. rst-class:: classref-item-separator
  825. ----
  826. .. _class_GraphEdit_method_set_connection_activity:
  827. .. rst-class:: classref-method
  828. |void| **set_connection_activity**\ (\ from_node\: :ref:`StringName<class_StringName>`, from_port\: :ref:`int<class_int>`, to_node\: :ref:`StringName<class_StringName>`, to_port\: :ref:`int<class_int>`, amount\: :ref:`float<class_float>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_set_connection_activity>`
  829. 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. The color is linearly interpolated between the connection color and the activity color using ``amount`` as weight.
  830. .. rst-class:: classref-item-separator
  831. ----
  832. .. _class_GraphEdit_method_set_selected:
  833. .. rst-class:: classref-method
  834. |void| **set_selected**\ (\ node\: :ref:`Node<class_Node>`\ ) :ref:`๐Ÿ”—<class_GraphEdit_method_set_selected>`
  835. Sets the specified ``node`` as the one selected.
  836. .. rst-class:: classref-section-separator
  837. ----
  838. .. rst-class:: classref-descriptions-group
  839. Theme Property Descriptions
  840. ---------------------------
  841. .. _class_GraphEdit_theme_color_activity:
  842. .. rst-class:: classref-themeproperty
  843. :ref:`Color<class_Color>` **activity** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_activity>`
  844. Color the connection line is interpolated to based on the activity value of a connection (see :ref:`set_connection_activity()<class_GraphEdit_method_set_connection_activity>`).
  845. .. rst-class:: classref-item-separator
  846. ----
  847. .. _class_GraphEdit_theme_color_connection_hover_tint_color:
  848. .. rst-class:: classref-themeproperty
  849. :ref:`Color<class_Color>` **connection_hover_tint_color** = ``Color(0, 0, 0, 0.3)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_connection_hover_tint_color>`
  850. Color which is blended with the connection line when the mouse is hovering over it.
  851. .. rst-class:: classref-item-separator
  852. ----
  853. .. _class_GraphEdit_theme_color_connection_rim_color:
  854. .. rst-class:: classref-themeproperty
  855. :ref:`Color<class_Color>` **connection_rim_color** = ``Color(0.1, 0.1, 0.1, 0.6)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_connection_rim_color>`
  856. Color of the rim around each connection line used for making intersecting lines more distinguishable.
  857. .. rst-class:: classref-item-separator
  858. ----
  859. .. _class_GraphEdit_theme_color_connection_valid_target_tint_color:
  860. .. rst-class:: classref-themeproperty
  861. :ref:`Color<class_Color>` **connection_valid_target_tint_color** = ``Color(1, 1, 1, 0.4)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_connection_valid_target_tint_color>`
  862. Color which is blended with the connection line when the currently dragged connection is hovering over a valid target port.
  863. .. rst-class:: classref-item-separator
  864. ----
  865. .. _class_GraphEdit_theme_color_grid_major:
  866. .. rst-class:: classref-themeproperty
  867. :ref:`Color<class_Color>` **grid_major** = ``Color(1, 1, 1, 0.2)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_grid_major>`
  868. Color of major grid lines/dots.
  869. .. rst-class:: classref-item-separator
  870. ----
  871. .. _class_GraphEdit_theme_color_grid_minor:
  872. .. rst-class:: classref-themeproperty
  873. :ref:`Color<class_Color>` **grid_minor** = ``Color(1, 1, 1, 0.05)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_grid_minor>`
  874. Color of minor grid lines/dots.
  875. .. rst-class:: classref-item-separator
  876. ----
  877. .. _class_GraphEdit_theme_color_selection_fill:
  878. .. rst-class:: classref-themeproperty
  879. :ref:`Color<class_Color>` **selection_fill** = ``Color(1, 1, 1, 0.3)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_selection_fill>`
  880. The fill color of the selection rectangle.
  881. .. rst-class:: classref-item-separator
  882. ----
  883. .. _class_GraphEdit_theme_color_selection_stroke:
  884. .. rst-class:: classref-themeproperty
  885. :ref:`Color<class_Color>` **selection_stroke** = ``Color(1, 1, 1, 0.8)`` :ref:`๐Ÿ”—<class_GraphEdit_theme_color_selection_stroke>`
  886. The outline color of the selection rectangle.
  887. .. rst-class:: classref-item-separator
  888. ----
  889. .. _class_GraphEdit_theme_constant_connection_hover_thickness:
  890. .. rst-class:: classref-themeproperty
  891. :ref:`int<class_int>` **connection_hover_thickness** = ``0`` :ref:`๐Ÿ”—<class_GraphEdit_theme_constant_connection_hover_thickness>`
  892. Widen the line of the connection when the mouse is hovering over it by a percentage factor. A value of ``0`` disables the highlight. A value of ``100`` doubles the line width.
  893. .. rst-class:: classref-item-separator
  894. ----
  895. .. _class_GraphEdit_theme_constant_port_hotzone_inner_extent:
  896. .. rst-class:: classref-themeproperty
  897. :ref:`int<class_int>` **port_hotzone_inner_extent** = ``22`` :ref:`๐Ÿ”—<class_GraphEdit_theme_constant_port_hotzone_inner_extent>`
  898. The horizontal range within which a port can be grabbed (inner side).
  899. .. rst-class:: classref-item-separator
  900. ----
  901. .. _class_GraphEdit_theme_constant_port_hotzone_outer_extent:
  902. .. rst-class:: classref-themeproperty
  903. :ref:`int<class_int>` **port_hotzone_outer_extent** = ``26`` :ref:`๐Ÿ”—<class_GraphEdit_theme_constant_port_hotzone_outer_extent>`
  904. The horizontal range within which a port can be grabbed (outer side).
  905. .. rst-class:: classref-item-separator
  906. ----
  907. .. _class_GraphEdit_theme_icon_grid_toggle:
  908. .. rst-class:: classref-themeproperty
  909. :ref:`Texture2D<class_Texture2D>` **grid_toggle** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_grid_toggle>`
  910. The icon for the grid toggle button.
  911. .. rst-class:: classref-item-separator
  912. ----
  913. .. _class_GraphEdit_theme_icon_layout:
  914. .. rst-class:: classref-themeproperty
  915. :ref:`Texture2D<class_Texture2D>` **layout** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_layout>`
  916. The icon for the layout button for auto-arranging the graph.
  917. .. rst-class:: classref-item-separator
  918. ----
  919. .. _class_GraphEdit_theme_icon_minimap_toggle:
  920. .. rst-class:: classref-themeproperty
  921. :ref:`Texture2D<class_Texture2D>` **minimap_toggle** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_minimap_toggle>`
  922. The icon for the minimap toggle button.
  923. .. rst-class:: classref-item-separator
  924. ----
  925. .. _class_GraphEdit_theme_icon_snapping_toggle:
  926. .. rst-class:: classref-themeproperty
  927. :ref:`Texture2D<class_Texture2D>` **snapping_toggle** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_snapping_toggle>`
  928. The icon for the snapping toggle button.
  929. .. rst-class:: classref-item-separator
  930. ----
  931. .. _class_GraphEdit_theme_icon_zoom_in:
  932. .. rst-class:: classref-themeproperty
  933. :ref:`Texture2D<class_Texture2D>` **zoom_in** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_zoom_in>`
  934. The icon for the zoom in button.
  935. .. rst-class:: classref-item-separator
  936. ----
  937. .. _class_GraphEdit_theme_icon_zoom_out:
  938. .. rst-class:: classref-themeproperty
  939. :ref:`Texture2D<class_Texture2D>` **zoom_out** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_zoom_out>`
  940. The icon for the zoom out button.
  941. .. rst-class:: classref-item-separator
  942. ----
  943. .. _class_GraphEdit_theme_icon_zoom_reset:
  944. .. rst-class:: classref-themeproperty
  945. :ref:`Texture2D<class_Texture2D>` **zoom_reset** :ref:`๐Ÿ”—<class_GraphEdit_theme_icon_zoom_reset>`
  946. The icon for the zoom reset button.
  947. .. rst-class:: classref-item-separator
  948. ----
  949. .. _class_GraphEdit_theme_style_menu_panel:
  950. .. rst-class:: classref-themeproperty
  951. :ref:`StyleBox<class_StyleBox>` **menu_panel** :ref:`๐Ÿ”—<class_GraphEdit_theme_style_menu_panel>`
  952. .. container:: contribute
  953. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  954. .. rst-class:: classref-item-separator
  955. ----
  956. .. _class_GraphEdit_theme_style_panel:
  957. .. rst-class:: classref-themeproperty
  958. :ref:`StyleBox<class_StyleBox>` **panel** :ref:`๐Ÿ”—<class_GraphEdit_theme_style_panel>`
  959. The background drawn under the grid.
  960. .. rst-class:: classref-item-separator
  961. ----
  962. .. _class_GraphEdit_theme_style_panel_focus:
  963. .. rst-class:: classref-themeproperty
  964. :ref:`StyleBox<class_StyleBox>` **panel_focus** :ref:`๐Ÿ”—<class_GraphEdit_theme_style_panel_focus>`
  965. :ref:`StyleBox<class_StyleBox>` used when the **GraphEdit** is focused (when used with assistive apps).
  966. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  967. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  968. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  969. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  970. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  971. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  972. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  973. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  974. .. |void| replace:: :abbr:`void (No return value.)`