class_graphedit.rst 61 KB

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