:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.1/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.1/doc/classes/GraphNode.xml. .. _class_GraphNode: GraphNode ========= **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` A container with connection ports, representing a node in a :ref:`GraphEdit`. .. rst-class:: classref-introduction-group Description ----------- **GraphNode** allows to create nodes for a :ref:`GraphEdit` graph with customizable content based on its child controls. **GraphNode** is derived from :ref:`Container` and it is responsible for placing its children on screen. This works similar to :ref:`VBoxContainer`. Children, in turn, provide **GraphNode** with so-called slots, each of which can have a connection port on either side. Each **GraphNode** slot is defined by its index and can provide the node with up to two ports: one on the left, and one on the right. By convention the left port is also referred to as the **input port** and the right port is referred to as the **output port**. Each port can be enabled and configured individually, using different type and color. The type is an arbitrary value that you can define using your own considerations. The parent :ref:`GraphEdit` will receive this information on each connect and disconnect request. Slots can be configured in the Inspector dock once you add at least one child :ref:`Control`. The properties are grouped by each slot's index in the "Slot" section. \ **Note:** While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that, :ref:`GraphEdit` uses the port's index and not the slot's index. You can use :ref:`get_connection_input_slot` and :ref:`get_connection_output_slot` to get the slot index from the port index. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`comment` | ``false`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`draggable` | ``true`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`String` | :ref:`language` | ``""`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`MouseFilter` | mouse_filter | ``0`` (overrides :ref:`Control`) | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`Overlay` | :ref:`overlay` | ``0`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`position_offset` | ``Vector2(0, 0)`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`resizable` | ``false`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`selectable` | ``true`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`selected` | ``false`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`bool` | :ref:`show_close` | ``false`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`TextDirection` | :ref:`text_direction` | ``0`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ | :ref:`String` | :ref:`title` | ``""`` | +--------------------------------------------------+------------------------------------------------------------------+-----------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_all_slots` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_slot` **(** :ref:`int` slot_index **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_connection_input_color` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_count` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_height` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_connection_input_position` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_slot` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_type` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_connection_output_color` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_count` **(** **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_height` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_connection_output_position` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_slot` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_type` **(** :ref:`int` port **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_slot_color_left` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_slot_color_right` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_left` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_right` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_slot_draw_stylebox` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_slot_enabled_left` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_slot_enabled_right` **(** :ref:`int` slot_index **)** |const| | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot` **(** :ref:`int` slot_index, :ref:`bool` enable_left_port, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right_port, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture2D` custom_icon_left=null, :ref:`Texture2D` custom_icon_right=null, :ref:`bool` draw_stylebox=true **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_color_left` **(** :ref:`int` slot_index, :ref:`Color` color **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_color_right` **(** :ref:`int` slot_index, :ref:`Color` color **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_draw_stylebox` **(** :ref:`int` slot_index, :ref:`bool` enable **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_enabled_left` **(** :ref:`int` slot_index, :ref:`bool` enable **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_enabled_right` **(** :ref:`int` slot_index, :ref:`bool` enable **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_type_left` **(** :ref:`int` slot_index, :ref:`int` type **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot_type_right` **(** :ref:`int` slot_index, :ref:`int` type **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Theme Properties ---------------- .. table:: :widths: auto +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Color` | :ref:`close_color` | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Color` | :ref:`resizer_color` | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Color` | :ref:`title_color` | ``Color(0.875, 0.875, 0.875, 1)`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`close_h_offset` | ``12`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`close_offset` | ``22`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`port_offset` | ``0`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`separation` | ``2`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`title_h_offset` | ``0`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`int` | :ref:`title_offset` | ``26`` | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Font` | :ref:`title_font` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Texture2D` | :ref:`close` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Texture2D` | :ref:`port` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`Texture2D` | :ref:`resizer` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`breakpoint` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`comment` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`comment_focus` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`frame` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`position` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`selected_frame` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ | :ref:`StyleBox` | :ref:`slot` | | +-----------------------------------+----------------------------------------------------------------------+-----------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_GraphNode_signal_close_request: .. rst-class:: classref-signal **close_request** **(** **)** Emitted when the GraphNode is requested to be closed. Happens on clicking the close button (see :ref:`show_close`). .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_dragged: .. rst-class:: classref-signal **dragged** **(** :ref:`Vector2` from, :ref:`Vector2` to **)** Emitted when the GraphNode is dragged. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_node_deselected: .. rst-class:: classref-signal **node_deselected** **(** **)** Emitted when the GraphNode is deselected. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_node_selected: .. rst-class:: classref-signal **node_selected** **(** **)** Emitted when the GraphNode is selected. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_position_offset_changed: .. rst-class:: classref-signal **position_offset_changed** **(** **)** Emitted when the GraphNode is moved. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_raise_request: .. rst-class:: classref-signal **raise_request** **(** **)** Emitted when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_resize_request: .. rst-class:: classref-signal **resize_request** **(** :ref:`Vector2` new_minsize **)** Emitted when the GraphNode is requested to be resized. Happens on dragging the resizer handle (see :ref:`resizable`). .. rst-class:: classref-item-separator ---- .. _class_GraphNode_signal_slot_updated: .. rst-class:: classref-signal **slot_updated** **(** :ref:`int` idx **)** Emitted when any GraphNode's slot is updated. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_GraphNode_Overlay: .. rst-class:: classref-enumeration enum **Overlay**: .. _class_GraphNode_constant_OVERLAY_DISABLED: .. rst-class:: classref-enumeration-constant :ref:`Overlay` **OVERLAY_DISABLED** = ``0`` No overlay is shown. .. _class_GraphNode_constant_OVERLAY_BREAKPOINT: .. rst-class:: classref-enumeration-constant :ref:`Overlay` **OVERLAY_BREAKPOINT** = ``1`` Show overlay set in the :ref:`breakpoint` theme property. .. _class_GraphNode_constant_OVERLAY_POSITION: .. rst-class:: classref-enumeration-constant :ref:`Overlay` **OVERLAY_POSITION** = ``2`` Show overlay set in the :ref:`position` theme property. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GraphNode_property_comment: .. rst-class:: classref-property :ref:`bool` **comment** = ``false`` .. rst-class:: classref-property-setget - void **set_comment** **(** :ref:`bool` value **)** - :ref:`bool` **is_comment** **(** **)** If ``true``, the GraphNode is a comment node. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_draggable: .. rst-class:: classref-property :ref:`bool` **draggable** = ``true`` .. rst-class:: classref-property-setget - void **set_draggable** **(** :ref:`bool` value **)** - :ref:`bool` **is_draggable** **(** **)** If ``true``, the user can drag the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_language: .. rst-class:: classref-property :ref:`String` **language** = ``""`` .. rst-class:: classref-property-setget - void **set_language** **(** :ref:`String` value **)** - :ref:`String` **get_language** **(** **)** Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_overlay: .. rst-class:: classref-property :ref:`Overlay` **overlay** = ``0`` .. rst-class:: classref-property-setget - void **set_overlay** **(** :ref:`Overlay` value **)** - :ref:`Overlay` **get_overlay** **(** **)** Sets the overlay shown above the GraphNode. See :ref:`Overlay`. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_position_offset: .. rst-class:: classref-property :ref:`Vector2` **position_offset** = ``Vector2(0, 0)`` .. rst-class:: classref-property-setget - void **set_position_offset** **(** :ref:`Vector2` value **)** - :ref:`Vector2` **get_position_offset** **(** **)** The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit`. \ **Note:** You cannot use position offset directly, as :ref:`GraphEdit` is a :ref:`Container`. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_resizable: .. rst-class:: classref-property :ref:`bool` **resizable** = ``false`` .. rst-class:: classref-property-setget - void **set_resizable** **(** :ref:`bool` value **)** - :ref:`bool` **is_resizable** **(** **)** If ``true``, the user can resize the GraphNode. \ **Note:** Dragging the handle will only emit the :ref:`resize_request` signal, the GraphNode needs to be resized manually. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_selectable: .. rst-class:: classref-property :ref:`bool` **selectable** = ``true`` .. rst-class:: classref-property-setget - void **set_selectable** **(** :ref:`bool` value **)** - :ref:`bool` **is_selectable** **(** **)** If ``true``, the user can select the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_selected: .. rst-class:: classref-property :ref:`bool` **selected** = ``false`` .. rst-class:: classref-property-setget - void **set_selected** **(** :ref:`bool` value **)** - :ref:`bool` **is_selected** **(** **)** If ``true``, the GraphNode is selected. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_show_close: .. rst-class:: classref-property :ref:`bool` **show_close** = ``false`` .. rst-class:: classref-property-setget - void **set_show_close_button** **(** :ref:`bool` value **)** - :ref:`bool` **is_close_button_visible** **(** **)** If ``true``, the close button will be visible. \ **Note:** Pressing it will only emit the :ref:`close_request` signal, the GraphNode needs to be removed manually. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_text_direction: .. rst-class:: classref-property :ref:`TextDirection` **text_direction** = ``0`` .. rst-class:: classref-property-setget - void **set_text_direction** **(** :ref:`TextDirection` value **)** - :ref:`TextDirection` **get_text_direction** **(** **)** Base text writing direction. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_property_title: .. rst-class:: classref-property :ref:`String` **title** = ``""`` .. rst-class:: classref-property-setget - void **set_title** **(** :ref:`String` value **)** - :ref:`String` **get_title** **(** **)** The text displayed in the GraphNode's title bar. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GraphNode_method_clear_all_slots: .. rst-class:: classref-method void **clear_all_slots** **(** **)** Disables all input and output slots of the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_clear_slot: .. rst-class:: classref-method void **clear_slot** **(** :ref:`int` slot_index **)** Disables input and output slot whose index is ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_color: .. rst-class:: classref-method :ref:`Color` **get_connection_input_color** **(** :ref:`int` port **)** Returns the :ref:`Color` of the input connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_count: .. rst-class:: classref-method :ref:`int` **get_connection_input_count** **(** **)** Returns the number of enabled input slots (connections) to the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_height: .. rst-class:: classref-method :ref:`int` **get_connection_input_height** **(** :ref:`int` port **)** Returns the height of the input connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_position: .. rst-class:: classref-method :ref:`Vector2` **get_connection_input_position** **(** :ref:`int` port **)** Returns the position of the input connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_slot: .. rst-class:: classref-method :ref:`int` **get_connection_input_slot** **(** :ref:`int` port **)** Returns the corresponding slot index of the input connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_input_type: .. rst-class:: classref-method :ref:`int` **get_connection_input_type** **(** :ref:`int` port **)** Returns the type of the input connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_color: .. rst-class:: classref-method :ref:`Color` **get_connection_output_color** **(** :ref:`int` port **)** Returns the :ref:`Color` of the output connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_count: .. rst-class:: classref-method :ref:`int` **get_connection_output_count** **(** **)** Returns the number of enabled output slots (connections) of the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_height: .. rst-class:: classref-method :ref:`int` **get_connection_output_height** **(** :ref:`int` port **)** Returns the height of the output connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_position: .. rst-class:: classref-method :ref:`Vector2` **get_connection_output_position** **(** :ref:`int` port **)** Returns the position of the output connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_slot: .. rst-class:: classref-method :ref:`int` **get_connection_output_slot** **(** :ref:`int` port **)** Returns the corresponding slot index of the output connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_connection_output_type: .. rst-class:: classref-method :ref:`int` **get_connection_output_type** **(** :ref:`int` port **)** Returns the type of the output connection ``port``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_slot_color_left: .. rst-class:: classref-method :ref:`Color` **get_slot_color_left** **(** :ref:`int` slot_index **)** |const| Returns the left (input) :ref:`Color` of the slot ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_slot_color_right: .. rst-class:: classref-method :ref:`Color` **get_slot_color_right** **(** :ref:`int` slot_index **)** |const| Returns the right (output) :ref:`Color` of the slot ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_slot_type_left: .. rst-class:: classref-method :ref:`int` **get_slot_type_left** **(** :ref:`int` slot_index **)** |const| Returns the left (input) type of the slot ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_get_slot_type_right: .. rst-class:: classref-method :ref:`int` **get_slot_type_right** **(** :ref:`int` slot_index **)** |const| Returns the right (output) type of the slot ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_is_slot_draw_stylebox: .. rst-class:: classref-method :ref:`bool` **is_slot_draw_stylebox** **(** :ref:`int` slot_index **)** |const| Returns true if the background :ref:`StyleBox` of the slot ``slot_index`` is drawn. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_is_slot_enabled_left: .. rst-class:: classref-method :ref:`bool` **is_slot_enabled_left** **(** :ref:`int` slot_index **)** |const| Returns ``true`` if left (input) side of the slot ``slot_index`` is enabled. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_is_slot_enabled_right: .. rst-class:: classref-method :ref:`bool` **is_slot_enabled_right** **(** :ref:`int` slot_index **)** |const| Returns ``true`` if right (output) side of the slot ``slot_index`` is enabled. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot: .. rst-class:: classref-method void **set_slot** **(** :ref:`int` slot_index, :ref:`bool` enable_left_port, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right_port, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture2D` custom_icon_left=null, :ref:`Texture2D` custom_icon_right=null, :ref:`bool` draw_stylebox=true **)** Sets properties of the slot with the ``slot_index`` index. If ``enable_left_port``/``enable_right_port`` is ``true``, a port will appear and the slot will be able to be connected from this side. With ``type_left``/``type_right`` an arbitrary type can be assigned to each port. Two ports can be connected if they share the same type, or if the connection between their types is allowed in the parent :ref:`GraphEdit` (see :ref:`GraphEdit.add_valid_connection_type`). Keep in mind that the :ref:`GraphEdit` has the final say in accepting the connection. Type compatibility simply allows the :ref:`GraphEdit.connection_request` signal to be emitted. Ports can be further customized using ``color_left``/``color_right`` and ``custom_icon_left``/``custom_icon_right``. The color parameter adds a tint to the icon. The custom icon can be used to override the default port dot. Additionally, ``draw_stylebox`` can be used to enable or disable drawing of the background stylebox for each slot. See :ref:`slot`. Individual properties can also be set using one of the ``set_slot_*`` methods. \ **Note:** This method only sets properties of the slot. To create the slot itself, add a :ref:`Control`-derived child to the GraphNode. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_color_left: .. rst-class:: classref-method void **set_slot_color_left** **(** :ref:`int` slot_index, :ref:`Color` color **)** Sets the :ref:`Color` of the left (input) side of the slot ``slot_index`` to ``color``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_color_right: .. rst-class:: classref-method void **set_slot_color_right** **(** :ref:`int` slot_index, :ref:`Color` color **)** Sets the :ref:`Color` of the right (output) side of the slot ``slot_index`` to ``color``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_draw_stylebox: .. rst-class:: classref-method void **set_slot_draw_stylebox** **(** :ref:`int` slot_index, :ref:`bool` enable **)** Toggles the background :ref:`StyleBox` of the slot ``slot_index``. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_enabled_left: .. rst-class:: classref-method void **set_slot_enabled_left** **(** :ref:`int` slot_index, :ref:`bool` enable **)** Toggles the left (input) side of the slot ``slot_index``. If ``enable`` is ``true``, a port will appear on the left side and the slot will be able to be connected from this side. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_enabled_right: .. rst-class:: classref-method void **set_slot_enabled_right** **(** :ref:`int` slot_index, :ref:`bool` enable **)** Toggles the right (output) side of the slot ``slot_index``. If ``enable`` is ``true``, a port will appear on the right side and the slot will be able to be connected from this side. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_type_left: .. rst-class:: classref-method void **set_slot_type_left** **(** :ref:`int` slot_index, :ref:`int` type **)** Sets the left (input) type of the slot ``slot_index`` to ``type``. If the value is negative, all connections will be disallowed to be created via user inputs. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_method_set_slot_type_right: .. rst-class:: classref-method void **set_slot_type_right** **(** :ref:`int` slot_index, :ref:`int` type **)** Sets the right (output) type of the slot ``slot_index`` to ``type``. If the value is negative, all connections will be disallowed to be created via user inputs. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Theme Property Descriptions --------------------------- .. _class_GraphNode_theme_color_close_color: .. rst-class:: classref-themeproperty :ref:`Color` **close_color** = ``Color(0.875, 0.875, 0.875, 1)`` The color modulation applied to the close button icon. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_color_resizer_color: .. rst-class:: classref-themeproperty :ref:`Color` **resizer_color** = ``Color(0.875, 0.875, 0.875, 1)`` The color modulation applied to the resizer icon. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_color_title_color: .. rst-class:: classref-themeproperty :ref:`Color` **title_color** = ``Color(0.875, 0.875, 0.875, 1)`` Color of the title text. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_close_h_offset: .. rst-class:: classref-themeproperty :ref:`int` **close_h_offset** = ``12`` .. container:: contribute There is currently no description for this theme property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_close_offset: .. rst-class:: classref-themeproperty :ref:`int` **close_offset** = ``22`` The vertical offset of the close button. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_port_offset: .. rst-class:: classref-themeproperty :ref:`int` **port_offset** = ``0`` Horizontal offset for the ports. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_separation: .. rst-class:: classref-themeproperty :ref:`int` **separation** = ``2`` The vertical distance between ports. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_title_h_offset: .. rst-class:: classref-themeproperty :ref:`int` **title_h_offset** = ``0`` Horizontal offset of the title text. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_constant_title_offset: .. rst-class:: classref-themeproperty :ref:`int` **title_offset** = ``26`` Vertical offset of the title text. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_font_title_font: .. rst-class:: classref-themeproperty :ref:`Font` **title_font** Font used for the title text. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_icon_close: .. rst-class:: classref-themeproperty :ref:`Texture2D` **close** The icon for the close button, visible when :ref:`show_close` is enabled. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_icon_port: .. rst-class:: classref-themeproperty :ref:`Texture2D` **port** The icon used for representing ports. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_icon_resizer: .. rst-class:: classref-themeproperty :ref:`Texture2D` **resizer** The icon used for resizer, visible when :ref:`resizable` is enabled. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_breakpoint: .. rst-class:: classref-themeproperty :ref:`StyleBox` **breakpoint** The background used when :ref:`overlay` is set to :ref:`OVERLAY_BREAKPOINT`. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_comment: .. rst-class:: classref-themeproperty :ref:`StyleBox` **comment** The :ref:`StyleBox` used when :ref:`comment` is enabled. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_comment_focus: .. rst-class:: classref-themeproperty :ref:`StyleBox` **comment_focus** The :ref:`StyleBox` used when :ref:`comment` is enabled and the **GraphNode** is focused. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_frame: .. rst-class:: classref-themeproperty :ref:`StyleBox` **frame** The default background for **GraphNode**. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_position: .. rst-class:: classref-themeproperty :ref:`StyleBox` **position** The background used when :ref:`overlay` is set to :ref:`OVERLAY_POSITION`. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_selected_frame: .. rst-class:: classref-themeproperty :ref:`StyleBox` **selected_frame** The background used when the **GraphNode** is selected. .. rst-class:: classref-item-separator ---- .. _class_GraphNode_theme_style_slot: .. rst-class:: classref-themeproperty :ref:`StyleBox` **slot** The :ref:`StyleBox` used for each slot of the **GraphNode**. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`