GraphEdit

Inherits: Control < CanvasItem < Node < Object

Category: Core

Brief Description

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

Member Functions

Error connect_node ( String from, int from_port, String to, int to_port )
void disconnect_node ( String from, int from_port, String to, int to_port )
Array get_connection_list ( ) const
Vector2 get_scroll_ofs ( ) const
float get_zoom ( ) const
bool is_node_connected ( String from, int from_port, String to, int to_port )
bool is_right_disconnects_enabled ( ) const
void set_right_disconnects ( bool enable )
void set_zoom ( float p_zoom )

Signals

  • _begin_node_move ( )
  • _end_node_move ( )
  • connection_request ( String from, int from_slot, String to, int to_slot )
  • delete_nodes_request ( )
  • disconnection_request ( String from, int from_slot, String to, int to_slot )
  • duplicate_nodes_request ( )
  • popup_request ( Vector2 p_position )

Description

GraphEdit manages the showing of GraphNodes it contains, as well as connections an 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.set_low_processor_usage_mode) when using GraphEdits.

Member Function Description

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.

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

  • Array get_connection_list ( ) const

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” }

Return the scroll offset.

  • float get_zoom ( ) const

Return the current zoom value.

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

  • bool is_right_disconnects_enabled ( ) const

Return true is the disconnection of connections is enable in the visual GraphEdit. False otherwise.

  • void set_right_disconnects ( bool enable )

Enable the disconnection of existing connections in the visual GraphEdit by left-clicking a connection and releasing into the void.

  • void set_zoom ( float p_zoom )

Set the zoom value of the GraphEdit. Zoom value is between 0.01; 1.728.