class_graphedit.rst 85 KB

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