GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them.
    public class GraphEdit : Control

GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNodes slots is disabled by default.

It is greatly advised to enable low processor usage mode (see OS.LowProcessorUsageMode.set) when using GraphEdits.

Inheritance Chain

Constructors

    public GraphEdit()

Signals

    "_begin_node_move" ()

Signal sent at the beginning of a GraphNode movement.

    "_end_node_move" ()

Signal sent at the end of a GraphNode movement.

    "connection_request" (String from, int from_slot, String to, int to_slot)

Signal sent to the GraphEdit when the connection between ‘from_slot’ slot of ‘from’ GraphNode and ‘to_slot’ slot of ‘to’ GraphNode is attempted to be created.

    "connection_to_empty" (String from, int from_slot, Vector2 release_position)

    "delete_nodes_request" ()

Signal sent when a GraphNode is attempted to be removed from the GraphEdit.

    "disconnection_request" (String from, int from_slot, String to, int to_slot)

Signal sent to the GraphEdit when the connection between ‘from_slot’ slot of ‘from’ GraphNode and ‘to_slot’ slot of ‘to’ GraphNode is attempted to be removed.

    "duplicate_nodes_request" ()

Signal sent when a GraphNode is attempted to be duplicated in the GraphEdit.

    "node_selected" (Object node)

    "popup_request" (Vector2 p_position)

Signal sent when a popup is requested. Happens on right-clicking in the GraphEdit. ‘p_position’ is the position of the mouse pointer when the signal is sent.

    "scroll_offset_changed" (Vector2 ofs)

Properties

    public bool RightDisconnects { get; set; }

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

    public Vector2 ScrollOffset { get; set; }

The scroll offset.

    public int SnapDistance { get; set; }

The snapping distance in pixels.

    public bool UseSnap { get; set; }

If true, enables snapping.

    public float Zoom { get; set; }

The current zoom value.

Methods

    public Error ConnectNode(string from, int fromPort, string to, int toPort)

Create a connection between ‘from_port’ slot of ‘from’ GraphNode and ‘to_port’ slot of ‘to’ GraphNode. If the connection already exists, no connection is created.

    public void DisconnectNode(string from, int fromPort, string to, int toPort)

Remove the connection between ‘from_port’ slot of ‘from’ GraphNode and ‘to_port’ slot of ‘to’ GraphNode, if connection exists.

    public object[] GetConnectionList()

Return an Array containing the list of connections. A connection consists in a structure of the form {from_slot: 0, from: “GraphNode name 0”, to_slot: 1, to: “GraphNode name 1” }

    public Vector2 GetScrollOfs()

Getter for ScrollOffset

    public int GetSnap()

Getter for SnapDistance

    public float GetZoom()

Getter for Zoom

    public bool IsNodeConnected(string from, int fromPort, string to, int toPort)

Return true if the ‘from_port’ slot of ‘from’ GraphNode is connected to the ‘to_port’ slot of ‘to’ GraphNode.

    public bool IsRightDisconnectsEnabled()

Getter for RightDisconnects

    public bool IsUsingSnap()

Getter for UseSnap

    public void SetRightDisconnects(bool enable)

Setter for RightDisconnects

    public void SetScrollOfs(Vector2 ofs)

Setter for ScrollOffset

    public void SetSelected(Node node)

    public void SetSnap(int pixels)

Setter for SnapDistance

    public void SetUseSnap(bool enable)

Setter for UseSnap

    public void SetZoom(float pZoom)

Setter for Zoom

Tags: