Index · Object → Node → CanvasItem → Control → GraphEdit

GraphEdit

An editor for graph-like structures, using GraphNodes.

Class Description

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.

GraphEdit by itself is only an empty container, representing an infinite grid where GraphNodes can be placed. Each 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 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.

Performance: It is greatly advised to enable low-processor usage mode (see OS.low_processor_usage_mode) when using GraphEdits.

Note: Keep in mind that Node.get_children() will also return the connection layer node named _connection_layer due to technical limitations. This behavior may change in future releases.

Properties

var clip_contents: bool = true
var connection_lines_antialiased: bool = true

If true, the lines between nodes will use antialiasing.

var connection_lines_curvature: float = 0.5

The curvature of the lines between the nodes. 0 results in straight lines.

var connection_lines_thickness: float = 4.0

The thickness of the lines between the nodes.

var connections: Dictionary[] = []

The connections between GraphNodes.

A connection is represented as a Dictionary in the form of:

{
	from_node: StringName,
	from_port: int,
	to_node: StringName,
	to_port: int,
	keep_alive: bool
}

Connections with keep_alive set to false may be deleted automatically if invalid during a redraw.

var focus_mode: Control.FocusMode = 2
var grid_pattern: GraphEdit.GridPattern = 0

The pattern used for drawing the grid.

var minimap_enabled: bool = true

If true, the minimap is visible.

var minimap_opacity: float = 0.65

The opacity of the minimap rectangle.

var minimap_size: Vector2 = Vector2(240, 160)

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.

var panning_scheme: GraphEdit.PanningScheme = 0

Defines the control scheme for panning with mouse wheel.

var right_disconnects: bool = false

If true, enables disconnection of existing connections in the GraphEdit by dragging the right end.

var scroll_offset: Vector2 = Vector2(0, 0)

The scroll offset.

var show_arrange_button: bool = true

If true, the button to automatically arrange graph nodes is visible.

var show_grid: bool = true

If true, the grid is visible.

var show_grid_buttons: bool = true

If true, buttons that allow to configure grid and snapping options are visible.

var show_menu: bool = true

If true, the menu toolbar is visible.

var show_minimap_button: bool = true

If true, the button to toggle the minimap is visible.

var show_zoom_buttons: bool = true

If true, buttons that allow to change and reset the zoom level are visible.

var show_zoom_label: bool = false

If true, the label with the current zoom level is visible. The zoom level is displayed in percents.

var snapping_distance: int = 20

The snapping distance in pixels, also determines the grid line distance.

var snapping_enabled: bool = true

If true, enables snapping.

var type_names: Dictionary = {}

Dictionary of human-readable port type names.

var zoom: float = 1.0

The current zoom value.

var zoom_max: float = 2.0736003

The upper zoom limit.

var zoom_min: float = 0.23256795

The lower zoom limit.

var zoom_step: float = 1.2

The step of each zoom level.

Inherited from Control (62)
var accessibility_controls_nodes: NodePath[] = []
var accessibility_flow_to_nodes: NodePath[] = []
var accessibility_labeled_by_nodes: NodePath[] = []
var anchor_bottom: float = 0.0
var anchor_left: float = 0.0
var anchor_right: float = 0.0
var anchor_top: float = 0.0
var clip_contents: bool = false
var custom_maximum_size: Vector2 = Vector2(-1, -1)
var custom_minimum_size: Vector2 = Vector2(0, 0)
var focus_neighbor_bottom: NodePath = NodePath("")
var focus_neighbor_left: NodePath = NodePath("")
var focus_neighbor_right: NodePath = NodePath("")
var focus_neighbor_top: NodePath = NodePath("")
var focus_next: NodePath = NodePath("")
var focus_previous: NodePath = NodePath("")
var offset_bottom: float = 0.0
var offset_left: float = 0.0
var offset_right: float = 0.0
var offset_top: float = 0.0
var offset_transform_pivot: Vector2 = Vector2(0, 0)
var offset_transform_pivot_ratio: Vector2 = Vector2(0.5, 0.5)
var offset_transform_position: Vector2 = Vector2(0, 0)
var offset_transform_scale: Vector2 = Vector2(1, 1)
var pivot_offset: Vector2 = Vector2(0, 0)
var pivot_offset_ratio: Vector2 = Vector2(0, 0)
var position: Vector2 = Vector2(0, 0)
var rotation: float = 0.0
var scale: Vector2 = Vector2(1, 1)
var size: Vector2 = Vector2(0, 0)
Inherited from CanvasItem (16)
var light_mask: int = 1
var modulate: Color = Color(1, 1, 1, 1)
var self_modulate: Color = Color(1, 1, 1, 1)
var top_level: bool = false
var visible: bool = true
var y_sort_enabled: bool = false
var z_as_relative: bool = true
var z_index: int = 0
Inherited from Node (14)
var owner: Node

Methods

func _get_connection_line(from_position: Vector2, to_position: Vector2) -> PackedVector2Array

Virtual method which can be overridden to customize how connections are drawn.

func _is_in_input_hotzone(in_node: Object, in_port: int, mouse_position: Vector2) -> bool

Returns whether the mouse_position is in the input hot zone.

By default, a hot zone is a Rect2 positioned such that its center is at in_node.GraphNode.get_input_port_position()(in_port) (For output's case, call GraphNode.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.

Below is a sample code to help get started:

func _is_in_input_hotzone(in_node, in_port, mouse_position):
	var port_size = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
	var port_pos = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
	var rect = Rect2(port_pos, port_size)

	return rect.has_point(mouse_position)
func _is_in_output_hotzone(in_node: Object, in_port: int, mouse_position: Vector2) -> bool

Returns whether the mouse_position is in the output hot zone. For more information on hot zones, see _is_in_input_hotzone().

Below is a sample code to help get started:

func _is_in_output_hotzone(in_node, in_port, mouse_position):
	var port_size = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
	var port_pos = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
	var rect = Rect2(port_pos, port_size)

	return rect.has_point(mouse_position)
func _is_node_hover_valid(from_node: StringName, from_port: int, to_node: StringName, to_port: int) -> bool

This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port.

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.

In this example a connection to same node is suppressed:

func _is_node_hover_valid(from, from_port, to, to_port):
	return from != to
func add_valid_connection_type(from_type: int, to_type: int) -> void

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 GraphNode.set_slot() method.

See also is_valid_connection_type() and remove_valid_connection_type().

func add_valid_left_disconnect_type(type: int) -> void

Allows to disconnect nodes when dragging from the left port of the GraphNode's slot if it has the specified type. See also remove_valid_left_disconnect_type().

func add_valid_right_disconnect_type(type: int) -> void

Allows to disconnect nodes when dragging from the right port of the GraphNode's slot if it has the specified type. See also remove_valid_right_disconnect_type().

func arrange_nodes() -> void

Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.

func attach_graph_element_to_frame(element: StringName, frame: StringName) -> void

Attaches the element GraphElement to the frame GraphFrame.

func clear_connections() -> void

Removes all connections between nodes.

func connect_node(from_node: StringName, from_port: int, to_node: StringName, to_port: int, keep_alive: bool = false) -> Error

Create a connection between the from_port of the from_node GraphNode and the to_port of the to_node GraphNode. If the connection already exists, no connection is created.

Connections with keep_alive set to false may be deleted automatically if invalid during a redraw.

func detach_graph_element_from_frame(element: StringName) -> void

Detaches the element GraphElement from the GraphFrame it is currently attached to.

func disconnect_node(from_node: StringName, from_port: int, to_node: StringName, to_port: int) -> void

Removes the connection between the from_port of the from_node GraphNode and the to_port of the to_node GraphNode. If the connection does not exist, no connection is removed.

func force_connection_drag_end() -> void

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.

This is best used together with connection_drag_started and connection_drag_ended to add custom behavior like node addition through shortcuts.

Note: This method suppresses any other connection request signals apart from connection_drag_ended.

func get_attached_nodes_of_frame(frame: StringName) -> StringName[]

Returns an array of node names that are attached to the GraphFrame with the given name.

func get_closest_connection_at_point(point: Vector2, max_distance: float = 4.0) -> Dictionary

Returns the closest connection to the given point in screen space. If no connection is found within max_distance pixels, an empty Dictionary is returned.

A connection is represented as a Dictionary in the form of:

{
	from_node: StringName,
	from_port: int,
	to_node: StringName,
	to_port: int,
	keep_alive: bool
}

For example, getting a connection at a given mouse position can be achieved like this:

var connection = get_closest_connection_at_point(mouse_event.get_position())
func get_connection_count(from_node: StringName, from_port: int) -> int

Returns the number of connections from from_port of from_node.

func get_connection_line(from_node: Vector2, to_node: Vector2) -> PackedVector2Array

Returns the points which would make up a connection between from_node and to_node.

func get_connection_list_from_node(node: StringName) -> Dictionary[]

Returns an Array containing a list of all connections for node.

A connection is represented as a Dictionary in the form of:

{
	from_node: StringName,
	from_port: int,
	to_node: StringName,
	to_port: int,
	keep_alive: bool
}

Example: Get all connections on a specific port:

func get_connection_list_from_port(node, port):
	var connections = get_connection_list_from_node(node)
	var result = []
	for connection in connections:
		var dict = {}
		if connection["from_node"] == node and connection["from_port"] == port:
			dict["node"] = connection["to_node"]
			dict["port"] = connection["to_port"]
			dict["type"] = "left"
			result.push_back(dict)
		elif connection["to_node"] == node and connection["to_port"] == port:
			dict["node"] = connection["from_node"]
			dict["port"] = connection["from_port"]
			dict["type"] = "right"
			result.push_back(dict)
	return result
func get_connections_intersecting_with_rect(rect: Rect2) -> Dictionary[]

Returns an Array containing the list of connections that intersect with the given Rect2.

A connection is represented as a Dictionary in the form of:

{
	from_node: StringName,
	from_port: int,
	to_node: StringName,
	to_port: int,
	keep_alive: bool
}
func get_element_frame(element: StringName) -> GraphFrame

Returns the GraphFrame that contains the GraphElement with the given name.

func get_menu_hbox() -> HBoxContainer

Gets the 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.

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 CanvasItem.visible property.

func is_node_connected(from_node: StringName, from_port: int, to_node: StringName, to_port: int) -> bool

Returns true if the from_port of the from_node GraphNode is connected to the to_port of the to_node GraphNode.

func is_valid_connection_type(from_type: int, to_type: int) -> bool

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 GraphNode.set_slot() method.

See also add_valid_connection_type() and remove_valid_connection_type().

func remove_valid_connection_type(from_type: int, to_type: int) -> void

Disallows the connection between two different port types previously allowed by add_valid_connection_type(). The port type is defined individually for the left and the right port of each slot with the GraphNode.set_slot() method.

See also is_valid_connection_type().

func remove_valid_left_disconnect_type(type: int) -> void

Disallows to disconnect nodes when dragging from the left port of the GraphNode's slot if it has the specified type. Use this to disable a disconnection previously allowed with add_valid_left_disconnect_type().

func remove_valid_right_disconnect_type(type: int) -> void

Disallows to disconnect nodes when dragging from the right port of the GraphNode's slot if it has the specified type. Use this to disable a disconnection previously allowed with add_valid_right_disconnect_type().

func set_connection_activity(from_node: StringName, from_port: int, to_node: StringName, to_port: int, amount: float) -> void

Sets the coloration of the connection between from_node's from_port and to_node's to_port with the color provided in the activity theme property. The color is linearly interpolated between the connection color and the activity color using amount as weight.

func set_selected(node: Node) -> void

Sets the specified node as the one selected.

Inherited from Control (100)
func _can_drop_data(at_position: Vector2, data: Variant) -> bool
func _drop_data(at_position: Vector2, data: Variant) -> void
func _get_cursor_shape(at_position: Vector2) -> int
func _get_drag_data(at_position: Vector2) -> Variant
func _get_tooltip(at_position: Vector2) -> String
func _gui_input(event: InputEvent) -> void
func _has_point(point: Vector2) -> bool
func _structured_text_parser(args: Array, text: String) -> Vector3i[]
func accept_event() -> void
func accessibility_drag() -> void
func accessibility_drop() -> void
func add_theme_color_override(name: StringName, color: Color) -> void
func add_theme_constant_override(name: StringName, constant: int) -> void
func add_theme_font_override(name: StringName, font: Font) -> void
func add_theme_font_size_override(name: StringName, font_size: int) -> void
func add_theme_icon_override(name: StringName, texture: Texture2D) -> void
func add_theme_stylebox_override(name: StringName, stylebox: StyleBox) -> void
func force_drag(data: Variant, preview: Control) -> void
func get_anchor(side: Side) -> float
func get_begin() -> Vector2
func get_cursor_shape(at_position: Vector2 = Vector2(0, 0)) -> Control.CursorShape
func get_end() -> Vector2
func get_focus_neighbor(side: Side) -> NodePath
func get_offset(offset: Side) -> float
func get_rect() -> Rect2
func get_theme_color(name: StringName, theme_type: StringName = &"") -> Color
func get_theme_constant(name: StringName, theme_type: StringName = &"") -> int
func get_theme_font(name: StringName, theme_type: StringName = &"") -> Font
func get_theme_font_size(name: StringName, theme_type: StringName = &"") -> int
func get_theme_icon(name: StringName, theme_type: StringName = &"") -> Texture2D
func get_theme_stylebox(name: StringName, theme_type: StringName = &"") -> StyleBox
func get_tooltip(at_position: Vector2 = Vector2(0, 0)) -> String
func grab_click_focus() -> void
func grab_focus(hide_focus: bool = false) -> void
func has_focus(ignore_hidden_focus: bool = false) -> bool
func has_theme_color(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_constant(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_font_size(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_icon(name: StringName, theme_type: StringName = &"") -> bool
func has_theme_stylebox(name: StringName, theme_type: StringName = &"") -> bool
func release_focus() -> void
func reset_size() -> void
func set_anchor(side: Side, anchor: float, keep_offset: bool = false, push_opposite_anchor: bool = true) -> void
func set_anchor_and_offset(side: Side, anchor: float, offset: float, push_opposite_anchor: bool = false) -> void
func set_anchors_and_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int = 0) -> void
func set_anchors_preset(preset: Control.LayoutPreset, keep_offsets: bool = false) -> void
func set_begin(position: Vector2) -> void
func set_drag_forwarding(drag_func: Callable, can_drop_func: Callable, drop_func: Callable) -> void
func set_drag_preview(control: Control) -> void
func set_end(position: Vector2) -> void
func set_focus_neighbor(side: Side, neighbor: NodePath) -> void
func set_global_position(position: Vector2, keep_offsets: bool = false) -> void
func set_offset(side: Side, offset: float) -> void
func set_offsets_preset(preset: Control.LayoutPreset, resize_mode: Control.LayoutPresetMode = 0, margin: int = 0) -> void
func set_position(position: Vector2, keep_offsets: bool = false) -> void
func set_size(size: Vector2, keep_offsets: bool = false) -> void
func update_maximum_size() -> void
func update_minimum_size() -> void
func warp_mouse(position: Vector2) -> void
Inherited from CanvasItem (62)
func _draw() -> void
func draw_animation_slice(animation_length: float, slice_begin: float, slice_end: float, offset: float = 0.0) -> void
func draw_arc(center: Vector2, radius: float, start_angle: float, end_angle: float, point_count: int, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_char(font: Font, pos: Vector2, char: String, font_size: int = 16, modulate: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) -> void
func draw_char_outline(font: Font, pos: Vector2, char: String, font_size: int = 16, size: int = -1, modulate: Color = Color(1, 1, 1, 1), oversampling: float = 0.0) -> void
func draw_circle(position: Vector2, radius: float, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_colored_polygon(points: PackedVector2Array, color: Color, uvs: PackedVector2Array = PackedVector2Array(), texture: Texture2D = null) -> void
func draw_dashed_line(from: Vector2, to: Vector2, color: Color, width: float = -1.0, dash: float = 2.0, aligned: bool = true, antialiased: bool = false) -> void
func draw_ellipse(position: Vector2, major: float, minor: float, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_ellipse_arc(center: Vector2, major: float, minor: float, start_angle: float, end_angle: float, point_count: int, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_end_animation() -> void
func draw_lcd_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_line(from: Vector2, to: Vector2, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_mesh(mesh: Mesh, texture: Texture2D, transform: Transform2D = Transform2D(1, 0, 0, 1, 0, 0), modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_msdf_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), outline: float = 0.0, pixel_range: float = 4.0, scale: float = 1.0) -> void
func draw_multiline(points: PackedVector2Array, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_multiline_colors(points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) -> void
func draw_multiline_string(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, max_lines: int = -1, modulate: Color = Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_multiline_string_outline(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, max_lines: int = -1, size: int = 1, modulate: Color = Color(1, 1, 1, 1), brk_flags: TextServer.LineBreakFlag = 3, justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_multimesh(multimesh: MultiMesh, texture: Texture2D) -> void
func draw_polygon(points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), texture: Texture2D = null) -> void
func draw_polyline(points: PackedVector2Array, color: Color, width: float = -1.0, antialiased: bool = false) -> void
func draw_polyline_colors(points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) -> void
func draw_primitive(points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: Texture2D = null) -> void
func draw_rect(rect: Rect2, color: Color, filled: bool = true, width: float = -1.0, antialiased: bool = false) -> void
func draw_set_transform(position: Vector2, rotation: float = 0.0, scale: Vector2 = Vector2(1, 1)) -> void
func draw_string(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, modulate: Color = Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_string_outline(font: Font, pos: Vector2, text: String, alignment: HorizontalAlignment = 0, width: float = -1, font_size: int = 16, size: int = 1, modulate: Color = Color(1, 1, 1, 1), justification_flags: TextServer.JustificationFlag = 3, direction: TextServer.Direction = 0, orientation: TextServer.Orientation = 0, oversampling: float = 0.0) -> void
func draw_style_box(style_box: StyleBox, rect: Rect2) -> void
func draw_texture(texture: Texture2D, position: Vector2, modulate: Color = Color(1, 1, 1, 1)) -> void
func draw_texture_rect(texture: Texture2D, rect: Rect2, tile: bool, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false) -> void
func draw_texture_rect_region(texture: Texture2D, rect: Rect2, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false, clip_uv: bool = true) -> void
func force_update_transform() -> void
func get_canvas() -> RID
func hide() -> void
func make_canvas_position_local(viewport_point: Vector2) -> Vector2
func move_to_front() -> void
func queue_redraw() -> void
func set_notify_local_transform(enable: bool) -> void
func set_notify_transform(enable: bool) -> void
func set_visibility_layer_bit(layer: int, enabled: bool) -> void
func show() -> void
Inherited from Node (106)
func _enter_tree() -> void
func _exit_tree() -> void
func _input(event: InputEvent) -> void
func _physics_process(delta: float) -> void
func _process(delta: float) -> void
func _ready() -> void
func _shortcut_input(event: InputEvent) -> void
func _unhandled_input(event: InputEvent) -> void
func _unhandled_key_input(event: InputEvent) -> void
func add_child(node: Node, force_readable_name: bool = false, internal: Node.InternalMode = 0) -> void
func add_sibling(sibling: Node, force_readable_name: bool = false) -> void
func add_to_group(group: StringName, persistent: bool = false) -> void
func atr(message: String, context: StringName = "") -> String
func atr_n(message: String, plural_message: StringName, n: int, context: StringName = "") -> String
func can_process() -> bool
func duplicate(flags: int = 15) -> Node
func find_child(pattern: String, recursive: bool = true, owned: bool = true) -> Node
func find_children(pattern: String, type: String = "", recursive: bool = true, owned: bool = true) -> Node[]
func find_parent(pattern: String) -> Node
func get_child(idx: int, include_internal: bool = false) -> Node
func get_child_count(include_internal: bool = false) -> int
func get_children(include_internal: bool = false) -> Node[]
func get_groups() -> StringName[]
func get_index(include_internal: bool = false) -> int
func get_node(path: NodePath) -> Node
func get_orphan_node_ids() -> int[]
func get_parent() -> Node
func get_path() -> NodePath
func get_path_to(node: Node, use_unique_path: bool = false) -> NodePath
func get_window() -> Window
func has_node(path: NodePath) -> bool
func is_ancestor_of(node: Node) -> bool
func is_greater_than(node: Node) -> bool
func is_in_group(group: StringName) -> bool
func move_child(child_node: Node, to_index: int) -> void
func notify_deferred_thread_group(what: int) -> void
func notify_thread_safe(what: int) -> void
func print_orphan_nodes() -> void
func print_tree() -> void
func print_tree_pretty() -> void
func propagate_call(method: StringName, args: Array = [], parent_first: bool = false) -> void
func propagate_notification(what: int) -> void
func queue_free() -> void
func remove_child(node: Node) -> void
func remove_from_group(group: StringName) -> void
func reparent(new_parent: Node, keep_global_transform: bool = true) -> void
func replace_by(node: Node, keep_groups: bool = false) -> void
func request_ready() -> void
func rpc(method: StringName) -> Error
func rpc_config(method: StringName, config: Variant) -> void
func rpc_id(peer_id: int, method: StringName) -> Error
func set_deferred_thread_group(property: StringName, value: Variant) -> void
func set_display_folded(fold: bool) -> void
func set_editable_instance(node: Node, is_editable: bool) -> void
func set_multiplayer_authority(id: int, recursive: bool = true) -> void
func set_physics_process(enable: bool) -> void
func set_physics_process_internal(enable: bool) -> void
func set_process(enable: bool) -> void
func set_process_input(enable: bool) -> void
func set_process_internal(enable: bool) -> void
func set_process_shortcut_input(enable: bool) -> void
func set_process_unhandled_input(enable: bool) -> void
func set_scene_instance_load_placeholder(load_placeholder: bool) -> void
func set_thread_safe(property: StringName, value: Variant) -> void
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

signal begin_node_move()

Emitted at the beginning of a GraphElement's movement.

signal connection_drag_ended()

Emitted at the end of a connection drag.

signal connection_drag_started(from_node: StringName, from_port: int, is_output: bool)

Emitted at the beginning of a connection drag.

signal connection_from_empty(to_node: StringName, to_port: int, release_position: Vector2)

Emitted when user drags a connection from an input port into the empty space of the graph.

signal connection_request(from_node: StringName, from_port: int, to_node: StringName, to_port: int)

Emitted to the GraphEdit when the connection between the from_port of the from_node GraphNode and the to_port of the to_node GraphNode is attempted to be created.

signal connection_to_empty(from_node: StringName, from_port: int, release_position: Vector2)

Emitted when user drags a connection from an output port into the empty space of the graph.

signal copy_nodes_request()

Emitted when this GraphEdit captures a ui_copy action (Ctrl + C by default). In general, this signal indicates that the selected GraphElements should be copied.

signal cut_nodes_request()

Emitted when this GraphEdit captures a ui_cut action (Ctrl + X by default). In general, this signal indicates that the selected GraphElements should be cut.

signal delete_nodes_request(nodes: StringName[])

Emitted when this GraphEdit captures a ui_graph_delete action (Delete by default).

nodes is an array of node names that should be removed. These usually include all selected nodes.

signal disconnection_request(from_node: StringName, from_port: int, to_node: StringName, to_port: int)

Emitted to the GraphEdit when the connection between from_port of from_node GraphNode and to_port of to_node GraphNode is attempted to be removed.

signal duplicate_nodes_request()

Emitted when this GraphEdit captures a ui_graph_duplicate action (Ctrl + D by default). In general, this signal indicates that the selected GraphElements should be duplicated.

signal end_node_move()

Emitted at the end of a GraphElement's movement.

signal frame_rect_changed(frame: GraphFrame, new_rect: Rect2)

Emitted when the GraphFrame frame is resized to new_rect.

signal graph_elements_linked_to_frame_request(elements: Array, frame: StringName)

Emitted when one or more GraphElements are dropped onto the GraphFrame named frame, when they were not previously attached to any other one.

elements is an array of GraphElements to be attached.

signal node_deselected(node: Node)

Emitted when the given GraphElement node is deselected.

signal node_selected(node: Node)

Emitted when the given GraphElement node is selected.

signal paste_nodes_request()

Emitted when this GraphEdit captures a ui_paste action (Ctrl + V by default). In general, this signal indicates that previously copied GraphElements should be pasted.

signal popup_request(at_position: Vector2)

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.

signal scroll_offset_changed(offset: Vector2)

Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code.

Inherited from Control (10)
signal focus_entered()
signal focus_exited()
signal gui_input(event: InputEvent)
signal mouse_entered()
signal mouse_exited()
signal resized()
signal theme_changed()
Inherited from CanvasItem (4)
signal draw()
signal hidden()
Inherited from Node (11)
signal child_entered_tree(node: Node)
signal child_exiting_tree(node: Node)
signal ready()
signal renamed()
signal replacing_by(node: Node)
signal tree_entered()
signal tree_exited()
signal tree_exiting()
Inherited from Object (2)

Enums & Constants

enum PanningScheme
SCROLL_ZOOMS = 0

Mouse Wheel will zoom, Ctrl + Mouse Wheel will move the view.

SCROLL_PANS = 1

Mouse Wheel will move the view, Ctrl + Mouse Wheel will zoom.

enum GridPattern
GRID_PATTERN_LINES = 0

Draw the grid using solid lines.

GRID_PATTERN_DOTS = 1

Draw the grid using dots.