class_graphedit.rst 88 KB

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