.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_GraphEdit: GraphEdit ========= **Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. Member Functions ---------------- +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`connect_node` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`disconnect_node` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_connection_list` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_scroll_ofs` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_snap` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_zoom` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_node_connected` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_right_disconnects_enabled` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_using_snap` **(** **)** const | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_right_disconnects` **(** :ref:`bool` enable **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_scroll_ofs` **(** :ref:`Vector2` ofs **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_selected` **(** :ref:`Node` node **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_snap` **(** :ref:`int` pixels **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_use_snap` **(** :ref:`bool` enable **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_zoom` **(** :ref:`float` p_zoom **)** | +--------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 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** **(** :ref:`String` from, :ref:`int` from_slot, :ref:`String` to, :ref:`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. - **delete_nodes_request** **(** **)** Signal sent when a GraphNode is attempted to be removed from the GraphEdit. - **disconnection_request** **(** :ref:`String` from, :ref:`int` from_slot, :ref:`String` to, :ref:`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. - **popup_request** **(** :ref:`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. Description ----------- 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 :ref:`OS.set_low_processor_usage_mode`) when using GraphEdits. Member Function Description --------------------------- .. _class_GraphEdit_connect_node: - :ref:`int` **connect_node** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** 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. .. _class_GraphEdit_disconnect_node: - void **disconnect_node** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** Remove the connection between 'from_port' slot of 'from' GraphNode and 'to_port' slot of 'to' GraphNode, if connection exists. .. _class_GraphEdit_get_connection_list: - :ref:`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" } .. _class_GraphEdit_get_scroll_ofs: - :ref:`Vector2` **get_scroll_ofs** **(** **)** const Return the scroll offset. .. _class_GraphEdit_get_snap: - :ref:`int` **get_snap** **(** **)** const .. _class_GraphEdit_get_zoom: - :ref:`float` **get_zoom** **(** **)** const Return the current zoom value. .. _class_GraphEdit_is_node_connected: - :ref:`bool` **is_node_connected** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** Return true if the 'from_port' slot of 'from' GraphNode is connected to the 'to_port' slot of 'to' GraphNode. .. _class_GraphEdit_is_right_disconnects_enabled: - :ref:`bool` **is_right_disconnects_enabled** **(** **)** const Return true is the disconnection of connections is enable in the visual GraphEdit. False otherwise. .. _class_GraphEdit_is_using_snap: - :ref:`bool` **is_using_snap** **(** **)** const .. _class_GraphEdit_set_right_disconnects: - void **set_right_disconnects** **(** :ref:`bool` enable **)** Enable the disconnection of existing connections in the visual GraphEdit by left-clicking a connection and releasing into the void. .. _class_GraphEdit_set_scroll_ofs: - void **set_scroll_ofs** **(** :ref:`Vector2` ofs **)** .. _class_GraphEdit_set_selected: - void **set_selected** **(** :ref:`Node` node **)** .. _class_GraphEdit_set_snap: - void **set_snap** **(** :ref:`int` pixels **)** .. _class_GraphEdit_set_use_snap: - void **set_use_snap** **(** :ref:`bool` enable **)** .. _class_GraphEdit_set_zoom: - void **set_zoom** **(** :ref:`float` p_zoom **)** Set the zoom value of the GraphEdit. Zoom value is between 0.01; 1.728.