2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2024-02-12 13:55:02 +00:00
<class name= "GraphEdit" inherits= "Control" experimental= "" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2023-04-30 14:26:09 +00:00
An editor for graph-like structures, using [GraphNode]s.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2023-04-30 14:26:09 +00:00
[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.
2023-09-26 14:41:39 +00:00
[GraphEdit] by itself is only an empty container, representing an infinite grid where [GraphNode]s 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.
2022-09-09 13:29:51 +00:00
[b]Performance:[/b] It is greatly advised to enable low-processor usage mode (see [member OS.low_processor_usage_mode]) when using GraphEdits.
2024-06-29 17:39:34 +00:00
[b]Note:[/b] Keep in mind that [method Node.get_children] will also return the connection layer node named [code]_connection_layer[/code] due to technical limitations. This behavior may change in future releases.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
2021-08-22 15:37:22 +00:00
<method name= "_get_connection_line" qualifiers= "virtual const" >
2020-07-19 17:11:02 +00:00
<return type= "PackedVector2Array" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_position" type= "Vector2" />
<param index= "1" name= "to_position" type= "Vector2" />
2020-07-19 17:11:02 +00:00
<description >
Virtual method which can be overridden to customize how connections are drawn.
</description>
</method>
2021-08-23 12:04:18 +00:00
<method name= "_is_in_input_hotzone" qualifiers= "virtual" >
<return type= "bool" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "in_node" type= "Object" />
<param index= "1" name= "in_port" type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "2" name= "mouse_position" type= "Vector2" />
2021-08-23 12:04:18 +00:00
<description >
2022-08-12 16:07:53 +00:00
Returns whether the [param mouse_position] is in the input hot zone.
2023-08-09 16:31:15 +00:00
By default, a hot zone is a [Rect2] positioned such that its center is at [param in_node].[method GraphNode.get_input_port_position]([param in_port]) (For output's case, call [method GraphNode.get_output_port_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code].
2021-08-23 12:04:18 +00:00
Below is a sample code to help get started:
[codeblock]
2022-09-09 13:29:51 +00:00
func _is_in_input_hotzone(in_node, in_port, mouse_position):
2023-03-03 14:42:32 +00:00
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
2023-08-09 16:31:15 +00:00
var port_pos: Vector2 = in_node.get_position() + in_node.get_input_port_position(in_port) - port_size / 2
2022-09-09 13:29:51 +00:00
var rect = Rect2(port_pos, port_size)
2021-08-23 12:04:18 +00:00
return rect.has_point(mouse_position)
[/codeblock]
</description>
</method>
<method name= "_is_in_output_hotzone" qualifiers= "virtual" >
<return type= "bool" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "in_node" type= "Object" />
<param index= "1" name= "in_port" type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "2" name= "mouse_position" type= "Vector2" />
2021-08-23 12:04:18 +00:00
<description >
2022-08-12 16:07:53 +00:00
Returns whether the [param mouse_position] is in the output hot zone. For more information on hot zones, see [method _is_in_input_hotzone].
2021-08-23 12:04:18 +00:00
Below is a sample code to help get started:
[codeblock]
2022-09-09 13:29:51 +00:00
func _is_in_output_hotzone(in_node, in_port, mouse_position):
2023-03-03 14:42:32 +00:00
var port_size: Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical"))
2023-08-09 16:31:15 +00:00
var port_pos: Vector2 = in_node.get_position() + in_node.get_output_port_position(in_port) - port_size / 2
2022-09-09 13:29:51 +00:00
var rect = Rect2(port_pos, port_size)
2021-08-23 12:04:18 +00:00
return rect.has_point(mouse_position)
[/codeblock]
</description>
</method>
2021-08-01 01:19:55 +00:00
<method name= "_is_node_hover_valid" qualifiers= "virtual" >
<return type= "bool" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
<param index= "1" name= "from_port" type= "int" />
<param index= "2" name= "to_node" type= "StringName" />
<param index= "3" name= "to_port" type= "int" />
2021-08-01 01:19:55 +00:00
<description >
This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port.
Return [code]true[/code] if the connection is indeed valid or return [code]false[/code] 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:
[codeblocks]
[gdscript]
2022-09-09 13:29:51 +00:00
func _is_node_hover_valid(from, from_port, to, to_port):
2021-08-01 01:19:55 +00:00
return from != to
[/gdscript]
[csharp]
2023-01-31 17:21:09 +00:00
public override bool _IsNodeHoverValid(StringName fromNode, int fromPort, StringName toNode, int toPort)
{
return fromNode != toNode;
2021-08-01 01:19:55 +00:00
}
[/csharp]
[/codeblocks]
</description>
</method>
2018-01-31 00:09:41 +00:00
<method name= "add_valid_connection_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "from_type" type= "int" />
<param index= "1" name= "to_type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
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 [method GraphNode.set_slot] method.
See also [method is_valid_connection_type] and [method remove_valid_connection_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
<method name= "add_valid_left_disconnect_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
Allows to disconnect nodes when dragging from the left port of the [GraphNode]'s slot if it has the specified type. See also [method remove_valid_left_disconnect_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
<method name= "add_valid_right_disconnect_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
Allows to disconnect nodes when dragging from the right port of the [GraphNode]'s slot if it has the specified type. See also [method remove_valid_right_disconnect_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
2021-08-10 19:14:19 +00:00
<method name= "arrange_nodes" >
<return type= "void" />
<description >
Rearranges selected nodes in a layout with minimum crossings between connections and uniform horizontal and vertical gap between nodes.
</description>
</method>
2024-02-07 01:37:26 +00:00
<method name= "attach_graph_element_to_frame" >
<return type= "void" />
<param index= "0" name= "element" type= "StringName" />
<param index= "1" name= "frame" type= "StringName" />
<description >
Attaches the [param element] [GraphElement] to the [param frame] [GraphFrame].
</description>
</method>
2018-01-31 00:09:41 +00:00
<method name= "clear_connections" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2018-01-31 00:09:41 +00:00
<description >
2019-06-21 23:04:47 +00:00
Removes all connections between nodes.
2018-01-31 00:09:41 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "connect_node" >
2021-07-30 13:28:05 +00:00
<return type= "int" enum= "Error" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "1" name= "from_port" type= "int" />
2022-09-09 13:29:51 +00:00
<param index= "2" name= "to_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "3" name= "to_port" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Create a connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection already exists, no connection is created.
2017-09-12 20:42:36 +00:00
</description>
</method>
2024-02-07 01:37:26 +00:00
<method name= "detach_graph_element_from_frame" >
<return type= "void" />
<param index= "0" name= "element" type= "StringName" />
<description >
Detaches the [param element] [GraphElement] from the [GraphFrame] it is currently attached to.
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "disconnect_node" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "1" name= "from_port" type= "int" />
2022-09-09 13:29:51 +00:00
<param index= "2" name= "to_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "3" name= "to_port" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Removes the connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection does not exist, no connection is removed.
2017-09-12 20:42:36 +00:00
</description>
</method>
2021-07-26 14:31:31 +00:00
<method name= "force_connection_drag_end" >
<return type= "void" />
<description >
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.
2022-01-06 21:01:01 +00:00
This is best used together with [signal connection_drag_started] and [signal connection_drag_ended] to add custom behavior like node addition through shortcuts.
2021-07-26 14:31:31 +00:00
[b]Note:[/b] This method suppresses any other connection request signals apart from [signal connection_drag_ended].
</description>
</method>
2024-02-07 01:37:26 +00:00
<method name= "get_attached_nodes_of_frame" >
<return type= "StringName[]" />
<param index= "0" name= "frame" type= "StringName" />
<description >
Returns an array of node names that are attached to the [GraphFrame] with the given name.
</description>
</method>
2024-01-18 15:16:17 +00:00
<method name= "get_closest_connection_at_point" qualifiers= "const" >
<return type= "Dictionary" />
<param index= "0" name= "point" type= "Vector2" />
<param index= "1" name= "max_distance" type= "float" default= "4.0" />
<description >
Returns the closest connection to the given point in screen space. If no connection is found within [param max_distance] pixels, an empty [Dictionary] is returned.
A connection consists in a structure of the form [code]{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }[/code].
For example, getting a connection at a given mouse position can be achieved like this:
[codeblocks]
[gdscript]
var connection = get_closest_connection_at_point(mouse_event.get_position())
[/gdscript]
[/codeblocks]
</description>
</method>
<method name= "get_connection_line" qualifiers= "const" >
2020-07-19 17:11:02 +00:00
<return type= "PackedVector2Array" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "Vector2" />
<param index= "1" name= "to_node" type= "Vector2" />
2020-07-19 17:11:02 +00:00
<description >
2022-09-09 13:29:51 +00:00
Returns the points which would make up a connection between [param from_node] and [param to_node].
2020-07-19 17:11:02 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "get_connection_list" qualifiers= "const" >
2022-08-05 18:35:08 +00:00
<return type= "Dictionary[]" />
2017-09-12 20:42:36 +00:00
<description >
2024-01-18 15:16:17 +00:00
Returns an [Array] containing the list of connections. A connection consists in a structure of the form [code]{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }[/code].
</description>
</method>
<method name= "get_connections_intersecting_with_rect" qualifiers= "const" >
<return type= "Dictionary[]" />
<param index= "0" name= "rect" type= "Rect2" />
<description >
Returns an [Array] containing the list of connections that intersect with the given [Rect2]. A connection consists in a structure of the form [code]{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }[/code].
2017-09-12 20:42:36 +00:00
</description>
</method>
2024-02-07 01:37:26 +00:00
<method name= "get_element_frame" >
<return type= "GraphFrame" />
<param index= "0" name= "element" type= "StringName" />
<description >
Returns the [GraphFrame] that contains the [GraphElement] with the given name.
</description>
</method>
2023-07-10 15:26:02 +00:00
<method name= "get_menu_hbox" >
2021-07-30 13:28:05 +00:00
<return type= "HBoxContainer" />
2018-07-26 09:56:21 +00:00
<description >
2021-10-10 19:28:56 +00:00
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.
[b]Warning:[/b] 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 [member CanvasItem.visible] property.
2018-07-26 09:56:21 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "is_node_connected" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "1" name= "from_port" type= "int" />
2022-09-09 13:29:51 +00:00
<param index= "2" name= "to_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "3" name= "to_port" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Returns [code]true[/code] if the [param from_port] of the [param from_node] [GraphNode] is connected to the [param to_port] of the [param to_node] [GraphNode].
2017-09-12 20:42:36 +00:00
</description>
</method>
2018-01-31 00:09:41 +00:00
<method name= "is_valid_connection_type" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "bool" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "from_type" type= "int" />
<param index= "1" name= "to_type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
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 [method GraphNode.set_slot] method.
See also [method add_valid_connection_type] and [method remove_valid_connection_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
<method name= "remove_valid_connection_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "from_type" type= "int" />
<param index= "1" name= "to_type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
Disallows the connection between two different port types previously allowed by [method add_valid_connection_type]. The port type is defined individually for the left and the right port of each slot with the [method GraphNode.set_slot] method.
See also [method is_valid_connection_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
<method name= "remove_valid_left_disconnect_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
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 disconnection previously allowed with [method add_valid_left_disconnect_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
<method name= "remove_valid_right_disconnect_type" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "type" type= "int" />
2018-01-31 00:09:41 +00:00
<description >
2022-09-09 13:29:51 +00:00
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 disconnection previously allowed with [method add_valid_right_disconnect_type].
2018-01-31 00:09:41 +00:00
</description>
</method>
2018-07-26 09:56:21 +00:00
<method name= "set_connection_activity" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "1" name= "from_port" type= "int" />
2022-09-09 13:29:51 +00:00
<param index= "2" name= "to_node" type= "StringName" />
2022-08-06 18:11:48 +00:00
<param index= "3" name= "to_port" type= "int" />
<param index= "4" name= "amount" type= "float" />
2018-07-26 09:56:21 +00:00
<description >
2023-09-26 21:52:16 +00:00
Sets the coloration of the connection between [param from_node]'s [param from_port] and [param to_node]'s [param to_port] with the color provided in the [theme_item activity] theme property. The color is linearly interpolated between the connection color and the activity color using [param amount] as weight.
2018-07-26 09:56:21 +00:00
</description>
</method>
2017-09-12 20:42:36 +00:00
<method name= "set_selected" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "node" type= "Node" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-12 16:07:53 +00:00
Sets the specified [param node] as the one selected.
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
2018-01-11 22:38:35 +00:00
<members >
2022-01-23 17:14:31 +00:00
<member name= "clip_contents" type= "bool" setter= "set_clip_contents" getter= "is_clipping_contents" overrides= "Control" default= "true" />
2020-12-18 13:13:28 +00:00
<member name= "connection_lines_antialiased" type= "bool" setter= "set_connection_lines_antialiased" getter= "is_connection_lines_antialiased" default= "true" >
If [code]true[/code], the lines between nodes will use antialiasing.
</member>
2022-05-30 13:38:13 +00:00
<member name= "connection_lines_curvature" type= "float" setter= "set_connection_lines_curvature" getter= "get_connection_lines_curvature" default= "0.5" >
The curvature of the lines between the nodes. 0 results in straight lines.
</member>
2024-01-18 15:16:17 +00:00
<member name= "connection_lines_thickness" type= "float" setter= "set_connection_lines_thickness" getter= "get_connection_lines_thickness" default= "4.0" >
2020-12-18 13:13:28 +00:00
The thickness of the lines between the nodes.
</member>
2021-12-02 19:38:49 +00:00
<member name= "focus_mode" type= "int" setter= "set_focus_mode" getter= "get_focus_mode" overrides= "Control" enum= "Control.FocusMode" default= "2" />
2023-10-22 16:01:03 +00:00
<member name= "grid_pattern" type= "int" setter= "set_grid_pattern" getter= "get_grid_pattern" enum= "GraphEdit.GridPattern" default= "0" >
The pattern used for drawing the grid.
</member>
2020-11-06 19:16:45 +00:00
<member name= "minimap_enabled" type= "bool" setter= "set_minimap_enabled" getter= "is_minimap_enabled" default= "true" >
If [code]true[/code], the minimap is visible.
</member>
2020-12-17 17:40:32 +00:00
<member name= "minimap_opacity" type= "float" setter= "set_minimap_opacity" getter= "get_minimap_opacity" default= "0.65" >
2020-11-06 19:16:45 +00:00
The opacity of the minimap rectangle.
</member>
2019-09-24 17:45:03 +00:00
<member name= "minimap_size" type= "Vector2" setter= "set_minimap_size" getter= "get_minimap_size" default= "Vector2(240, 160)" >
2020-11-06 19:16:45 +00:00
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.
</member>
2021-09-28 16:00:16 +00:00
<member name= "panning_scheme" type= "int" setter= "set_panning_scheme" getter= "get_panning_scheme" enum= "GraphEdit.PanningScheme" default= "0" >
Defines the control scheme for panning with mouse wheel.
</member>
2019-06-29 10:38:01 +00:00
<member name= "right_disconnects" type= "bool" setter= "set_right_disconnects" getter= "is_right_disconnects_enabled" default= "false" >
2018-01-11 22:38:35 +00:00
If [code]true[/code], enables disconnection of existing connections in the GraphEdit by dragging the right end.
</member>
2023-07-10 15:26:02 +00:00
<member name= "scroll_offset" type= "Vector2" setter= "set_scroll_offset" getter= "get_scroll_offset" default= "Vector2(0, 0)" >
2018-01-11 22:38:35 +00:00
The scroll offset.
</member>
2023-10-02 11:43:08 +00:00
<member name= "show_arrange_button" type= "bool" setter= "set_show_arrange_button" getter= "is_showing_arrange_button" default= "true" >
If [code]true[/code], the button to automatically arrange graph nodes is visible.
</member>
2023-07-10 15:26:02 +00:00
<member name= "show_grid" type= "bool" setter= "set_show_grid" getter= "is_showing_grid" default= "true" >
If [code]true[/code], the grid is visible.
</member>
2023-10-02 11:43:08 +00:00
<member name= "show_grid_buttons" type= "bool" setter= "set_show_grid_buttons" getter= "is_showing_grid_buttons" default= "true" >
If [code]true[/code], buttons that allow to configure grid and snapping options are visible.
</member>
<member name= "show_menu" type= "bool" setter= "set_show_menu" getter= "is_showing_menu" default= "true" >
If [code]true[/code], the menu toolbar is visible.
</member>
<member name= "show_minimap_button" type= "bool" setter= "set_show_minimap_button" getter= "is_showing_minimap_button" default= "true" >
If [code]true[/code], the button to toggle the minimap is visible.
</member>
<member name= "show_zoom_buttons" type= "bool" setter= "set_show_zoom_buttons" getter= "is_showing_zoom_buttons" default= "true" >
If [code]true[/code], buttons that allow to change and reset the zoom level are visible.
</member>
2021-06-16 13:14:25 +00:00
<member name= "show_zoom_label" type= "bool" setter= "set_show_zoom_label" getter= "is_showing_zoom_label" default= "false" >
2023-10-02 11:43:08 +00:00
If [code]true[/code], the label with the current zoom level is visible. The zoom level is displayed in percents.
2021-06-16 13:14:25 +00:00
</member>
2023-07-10 15:26:02 +00:00
<member name= "snapping_distance" type= "int" setter= "set_snapping_distance" getter= "get_snapping_distance" default= "20" >
The snapping distance in pixels, also determines the grid line distance.
2018-01-11 22:38:35 +00:00
</member>
2023-07-10 15:26:02 +00:00
<member name= "snapping_enabled" type= "bool" setter= "set_snapping_enabled" getter= "is_snapping_enabled" default= "true" >
2018-01-11 22:38:35 +00:00
If [code]true[/code], enables snapping.
</member>
2019-06-29 10:38:01 +00:00
<member name= "zoom" type= "float" setter= "set_zoom" getter= "get_zoom" default= "1.0" >
2018-01-11 22:38:35 +00:00
The current zoom value.
</member>
2021-06-16 13:14:25 +00:00
<member name= "zoom_max" type= "float" setter= "set_zoom_max" getter= "get_zoom_max" default= "2.0736" >
The upper zoom limit.
</member>
<member name= "zoom_min" type= "float" setter= "set_zoom_min" getter= "get_zoom_min" default= "0.232568" >
The lower zoom limit.
</member>
<member name= "zoom_step" type= "float" setter= "set_zoom_step" getter= "get_zoom_step" default= "1.2" >
The step of each zoom level.
</member>
2018-01-11 22:38:35 +00:00
</members>
2017-09-12 20:42:36 +00:00
<signals >
2020-10-20 06:22:40 +00:00
<signal name= "begin_node_move" >
2017-09-12 20:42:36 +00:00
<description >
2024-01-10 16:31:17 +00:00
Emitted at the beginning of a [GraphElement]'s movement.
2017-09-12 20:42:36 +00:00
</description>
</signal>
2022-01-06 21:01:01 +00:00
<signal name= "connection_drag_ended" >
<description >
Emitted at the end of a connection drag.
</description>
</signal>
<signal name= "connection_drag_started" >
2022-08-12 11:06:08 +00:00
<param index= "0" name= "from_node" type= "StringName" />
2022-09-09 13:29:51 +00:00
<param index= "1" name= "from_port" type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "2" name= "is_output" type= "bool" />
2021-07-26 14:31:31 +00:00
<description >
Emitted at the beginning of a connection drag.
</description>
</signal>
2019-06-29 10:24:18 +00:00
<signal name= "connection_from_empty" >
2022-09-09 13:29:51 +00:00
<param index= "0" name= "to_node" type= "StringName" />
<param index= "1" name= "to_port" type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "2" name= "release_position" type= "Vector2" />
2019-06-29 10:24:18 +00:00
<description >
2022-09-09 13:29:51 +00:00
Emitted when user drags a connection from an input port into the empty space of the graph.
2019-06-29 10:24:18 +00:00
</description>
</signal>
2017-09-12 20:42:36 +00:00
<signal name= "connection_request" >
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
<param index= "1" name= "from_port" type= "int" />
<param index= "2" name= "to_node" type= "StringName" />
<param index= "3" name= "to_port" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Emitted to the GraphEdit when the connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode] is attempted to be created.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "connection_to_empty" >
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
<param index= "1" name= "from_port" type= "int" />
2022-08-06 18:11:48 +00:00
<param index= "2" name= "release_position" type= "Vector2" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Emitted when user drags a connection from an output port into the empty space of the graph.
2017-09-12 20:42:36 +00:00
</description>
</signal>
2019-07-12 17:36:33 +00:00
<signal name= "copy_nodes_request" >
2019-08-05 13:21:03 +00:00
<description >
2024-01-10 16:31:17 +00:00
Emitted when this [GraphEdit] captures a [code]ui_copy[/code] action ([kbd]Ctrl + C[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be copied.
2019-08-05 13:21:03 +00:00
</description>
2019-07-12 17:36:33 +00:00
</signal>
2023-09-26 14:41:39 +00:00
<signal name= "delete_nodes_request" >
<param index= "0" name= "nodes" type= "StringName[]" />
<description >
2024-01-10 16:31:17 +00:00
Emitted when this [GraphEdit] captures a [code]ui_graph_delete[/code] action ([kbd]Delete[/kbd] by default).
[param nodes] is an array of node names that should be removed. These usually include all selected nodes.
2023-09-26 14:41:39 +00:00
</description>
</signal>
2017-09-12 20:42:36 +00:00
<signal name= "disconnection_request" >
2022-09-09 13:29:51 +00:00
<param index= "0" name= "from_node" type= "StringName" />
<param index= "1" name= "from_port" type= "int" />
<param index= "2" name= "to_node" type= "StringName" />
<param index= "3" name= "to_port" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-09-09 13:29:51 +00:00
Emitted to the GraphEdit when the connection between [param from_port] of [param from_node] [GraphNode] and [param to_port] of [param to_node] [GraphNode] is attempted to be removed.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "duplicate_nodes_request" >
<description >
2024-01-10 16:31:17 +00:00
Emitted when this [GraphEdit] captures a [code]ui_graph_duplicate[/code] action ([kbd]Ctrl + D[/kbd] by default). In general, this signal indicates that the selected [GraphElement]s should be duplicated.
2017-09-12 20:42:36 +00:00
</description>
</signal>
2020-10-20 06:22:40 +00:00
<signal name= "end_node_move" >
<description >
2024-01-10 16:31:17 +00:00
Emitted at the end of a [GraphElement]'s movement.
2020-10-20 06:22:40 +00:00
</description>
</signal>
2024-02-07 01:37:26 +00:00
<signal name= "frame_rect_changed" >
<param index= "0" name= "frame" type= "GraphFrame" />
<param index= "1" name= "new_rect" type= "Vector2" />
<description >
Emitted when the [GraphFrame] [param frame] is resized to [param new_rect].
</description>
</signal>
<signal name= "graph_elements_linked_to_frame_request" >
<param index= "0" name= "elements" type= "Array" />
<param index= "1" name= "frame" type= "StringName" />
<description >
Emitted when one or more [GraphElement]s are dropped onto the [GraphFrame] named [param frame], when they were not previously attached to any other one.
[param elements] is an array of [GraphElement]s to be attached.
</description>
</signal>
2021-01-04 13:33:44 +00:00
<signal name= "node_deselected" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "node" type= "Node" />
2017-09-12 20:42:36 +00:00
<description >
2024-01-10 16:31:17 +00:00
Emitted when the given [GraphElement] node is deselected.
2017-09-12 20:42:36 +00:00
</description>
</signal>
2021-01-04 13:33:44 +00:00
<signal name= "node_selected" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "node" type= "Node" />
2020-04-20 09:48:00 +00:00
<description >
2024-01-10 16:31:17 +00:00
Emitted when the given [GraphElement] node is selected.
2020-04-20 09:48:00 +00:00
</description>
</signal>
2019-07-12 17:36:33 +00:00
<signal name= "paste_nodes_request" >
2019-08-05 13:21:03 +00:00
<description >
2024-01-10 16:31:17 +00:00
Emitted when this [GraphEdit] captures a [code]ui_paste[/code] action ([kbd]Ctrl + V[/kbd] by default). In general, this signal indicates that previously copied [GraphElement]s should be pasted.
2019-08-05 13:21:03 +00:00
</description>
2019-07-12 17:36:33 +00:00
</signal>
2017-09-12 20:42:36 +00:00
<signal name= "popup_request" >
2024-03-20 22:38:27 +00:00
<param index= "0" name= "at_position" type= "Vector2" />
2017-09-12 20:42:36 +00:00
<description >
2024-03-20 22:38:27 +00:00
Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. [param at_position] is the position of the mouse pointer when the signal is sent.
2017-09-12 20:42:36 +00:00
</description>
</signal>
<signal name= "scroll_offset_changed" >
2022-08-06 18:11:48 +00:00
<param index= "0" name= "offset" type= "Vector2" />
2017-09-12 20:42:36 +00:00
<description >
2020-01-08 01:05:32 +00:00
Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code.
2017-09-12 20:42:36 +00:00
</description>
</signal>
</signals>
2021-09-28 16:00:16 +00:00
<constants >
<constant name= "SCROLL_ZOOMS" value= "0" enum= "PanningScheme" >
[kbd]Mouse Wheel[/kbd] will zoom, [kbd]Ctrl + Mouse Wheel[/kbd] will move the view.
</constant>
<constant name= "SCROLL_PANS" value= "1" enum= "PanningScheme" >
[kbd]Mouse Wheel[/kbd] will move the view, [kbd]Ctrl + Mouse Wheel[/kbd] will zoom.
</constant>
2023-10-22 16:01:03 +00:00
<constant name= "GRID_PATTERN_LINES" value= "0" enum= "GridPattern" >
Draw the grid using solid lines.
</constant>
<constant name= "GRID_PATTERN_DOTS" value= "1" enum= "GridPattern" >
Draw the grid using dots.
</constant>
2021-09-28 16:00:16 +00:00
</constants>
2017-09-12 20:42:36 +00:00
<theme_items >
2021-08-04 16:54:41 +00:00
<theme_item name= "activity" data_type= "color" type= "Color" default= "Color(1, 1, 1, 1)" >
2024-01-18 15:16:17 +00:00
Color the connection line is interpolated to based on the activity value of a connection (see [method set_connection_activity]).
</theme_item>
<theme_item name= "connection_hover_tint_color" data_type= "color" type= "Color" default= "Color(0, 0, 0, 0.3)" >
Color which is blended with the connection line when the mouse is hovering over it.
</theme_item>
<theme_item name= "connection_rim_color" data_type= "color" type= "Color" default= "Color(0.1, 0.1, 0.1, 0.6)" >
Color of the rim around each connection line used for making intersecting lines more distinguishable.
</theme_item>
<theme_item name= "connection_valid_target_tint_color" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.4)" >
Color which is blended with the connection line when the currently dragged connection is hovering over a valid target port.
2018-07-26 09:56:21 +00:00
</theme_item>
2021-08-04 16:54:41 +00:00
<theme_item name= "grid_major" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.2)" >
2023-10-22 16:01:03 +00:00
Color of major grid lines/dots.
2017-09-12 20:42:36 +00:00
</theme_item>
2021-08-04 16:54:41 +00:00
<theme_item name= "grid_minor" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.05)" >
2023-10-22 16:01:03 +00:00
Color of minor grid lines/dots.
2017-09-12 20:42:36 +00:00
</theme_item>
2021-12-01 18:02:20 +00:00
<theme_item name= "selection_fill" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.3)" >
The fill color of the selection rectangle.
2021-08-10 19:14:19 +00:00
</theme_item>
2021-12-01 18:02:20 +00:00
<theme_item name= "selection_stroke" data_type= "color" type= "Color" default= "Color(1, 1, 1, 0.8)" >
The outline color of the selection rectangle.
2020-12-18 13:13:28 +00:00
</theme_item>
2022-05-30 13:48:58 +00:00
<theme_item name= "port_hotzone_inner_extent" data_type= "constant" type= "int" default= "22" >
The horizontal range within which a port can be grabbed (inner side).
2018-07-26 09:56:21 +00:00
</theme_item>
2022-05-30 13:48:58 +00:00
<theme_item name= "port_hotzone_outer_extent" data_type= "constant" type= "int" default= "26" >
The horizontal range within which a port can be grabbed (outer side).
2018-07-26 09:56:21 +00:00
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "grid_toggle" data_type= "icon" type= "Texture2D" >
The icon for the grid toggle button.
</theme_item>
2021-12-01 18:02:20 +00:00
<theme_item name= "layout" data_type= "icon" type= "Texture2D" >
2023-07-10 15:26:02 +00:00
The icon for the layout button for auto-arranging the graph.
2017-09-12 20:42:36 +00:00
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "minimap_toggle" data_type= "icon" type= "Texture2D" >
The icon for the minimap toggle button.
2020-01-08 02:09:40 +00:00
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "snapping_toggle" data_type= "icon" type= "Texture2D" >
The icon for the snapping toggle button.
2021-12-01 18:02:20 +00:00
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "zoom_in" data_type= "icon" type= "Texture2D" >
2021-12-01 18:02:20 +00:00
The icon for the zoom in button.
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "zoom_out" data_type= "icon" type= "Texture2D" >
The icon for the zoom out button.
2020-01-08 02:09:40 +00:00
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "zoom_reset" data_type= "icon" type= "Texture2D" >
The icon for the zoom reset button.
2017-10-21 10:02:08 +00:00
</theme_item>
2023-10-02 11:43:08 +00:00
<theme_item name= "menu_panel" data_type= "style" type= "StyleBox" >
</theme_item>
2023-07-10 15:26:02 +00:00
<theme_item name= "panel" data_type= "style" type= "StyleBox" >
2021-12-01 18:02:20 +00:00
The background drawn under the grid.
</theme_item>
2017-09-12 20:42:36 +00:00
</theme_items>
</class>