:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the GraphNode.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_GraphNode: GraphNode ========= **Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- A GraphNode is a container with several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types. Properties ---------- +----------------------------------------+--------------------------------------------------------+ | :ref:`bool` | :ref:`comment` | +----------------------------------------+--------------------------------------------------------+ | :ref:`Vector2` | :ref:`offset` | +----------------------------------------+--------------------------------------------------------+ | :ref:`Overlay` | :ref:`overlay` | +----------------------------------------+--------------------------------------------------------+ | :ref:`bool` | :ref:`resizable` | +----------------------------------------+--------------------------------------------------------+ | :ref:`bool` | :ref:`selected` | +----------------------------------------+--------------------------------------------------------+ | :ref:`bool` | :ref:`show_close` | +----------------------------------------+--------------------------------------------------------+ | :ref:`String` | :ref:`title` | +----------------------------------------+--------------------------------------------------------+ Methods ------- +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_all_slots` **(** **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_slot` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_connection_input_color` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_count` **(** **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_connection_input_position` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_input_type` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_connection_output_color` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_count` **(** **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_connection_output_position` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_connection_output_type` **(** :ref:`int` idx **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_slot_color_left` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`get_slot_color_right` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_left` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_slot_type_right` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_slot_enabled_left` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_slot_enabled_right` **(** :ref:`int` idx **)** const | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_slot` **(** :ref:`int` idx, :ref:`bool` enable_left, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture` custom_left=null, :ref:`Texture` custom_right=null **)** | +-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Theme Properties ---------------- +---------------------------------+---------------+ | :ref:`StyleBox` | breakpoint | +---------------------------------+---------------+ | :ref:`Texture` | close | +---------------------------------+---------------+ | :ref:`Color` | close_color | +---------------------------------+---------------+ | :ref:`int` | close_offset | +---------------------------------+---------------+ | :ref:`StyleBox` | comment | +---------------------------------+---------------+ | :ref:`StyleBox` | commentfocus | +---------------------------------+---------------+ | :ref:`StyleBox` | defaultfocus | +---------------------------------+---------------+ | :ref:`StyleBox` | defaultframe | +---------------------------------+---------------+ | :ref:`StyleBox` | frame | +---------------------------------+---------------+ | :ref:`Texture` | port | +---------------------------------+---------------+ | :ref:`int` | port_offset | +---------------------------------+---------------+ | :ref:`StyleBox` | position | +---------------------------------+---------------+ | :ref:`Texture` | resizer | +---------------------------------+---------------+ | :ref:`StyleBox` | selectedframe | +---------------------------------+---------------+ | :ref:`int` | separation | +---------------------------------+---------------+ | :ref:`Color` | title_color | +---------------------------------+---------------+ | :ref:`Font` | title_font | +---------------------------------+---------------+ | :ref:`int` | title_offset | +---------------------------------+---------------+ Signals ------- .. _class_GraphNode_signal_close_request: - **close_request** **(** **)** Signal sent on closing the GraphNode. ---- .. _class_GraphNode_signal_dragged: - **dragged** **(** :ref:`Vector2` from, :ref:`Vector2` to **)** Signal sent when the GraphNode is dragged. ---- .. _class_GraphNode_signal_offset_changed: - **offset_changed** **(** **)** Signal sent when the GraphNode is moved. ---- .. _class_GraphNode_signal_raise_request: - **raise_request** **(** **)** Signal sent when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode. ---- .. _class_GraphNode_signal_resize_request: - **resize_request** **(** :ref:`Vector2` new_minsize **)** Enumerations ------------ .. _enum_GraphNode_Overlay: .. _class_GraphNode_constant_OVERLAY_DISABLED: .. _class_GraphNode_constant_OVERLAY_BREAKPOINT: .. _class_GraphNode_constant_OVERLAY_POSITION: enum **Overlay**: - **OVERLAY_DISABLED** = **0** - **OVERLAY_BREAKPOINT** = **1** - **OVERLAY_POSITION** = **2** Description ----------- A GraphNode is a container defined by a title. It can have 1 or more input and output slots, which can be enabled (shown) or disabled (not shown) and have different (incompatible) types. Colors can also be assigned to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input and output connections are left and right slots, but only enabled slots are counted as connections. Property Descriptions --------------------- .. _class_GraphNode_property_comment: - :ref:`bool` **comment** +----------+--------------------+ | *Setter* | set_comment(value) | +----------+--------------------+ | *Getter* | is_comment() | +----------+--------------------+ ---- .. _class_GraphNode_property_offset: - :ref:`Vector2` **offset** +----------+-------------------+ | *Setter* | set_offset(value) | +----------+-------------------+ | *Getter* | get_offset() | +----------+-------------------+ The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit`. Note that you cannot use position directly, as :ref:`GraphEdit` is a :ref:`Container`. ---- .. _class_GraphNode_property_overlay: - :ref:`Overlay` **overlay** +----------+--------------------+ | *Setter* | set_overlay(value) | +----------+--------------------+ | *Getter* | get_overlay() | +----------+--------------------+ ---- .. _class_GraphNode_property_resizable: - :ref:`bool` **resizable** +----------+----------------------+ | *Setter* | set_resizable(value) | +----------+----------------------+ | *Getter* | is_resizable() | +----------+----------------------+ ---- .. _class_GraphNode_property_selected: - :ref:`bool` **selected** +----------+---------------------+ | *Setter* | set_selected(value) | +----------+---------------------+ | *Getter* | is_selected() | +----------+---------------------+ ---- .. _class_GraphNode_property_show_close: - :ref:`bool` **show_close** +----------+------------------------------+ | *Setter* | set_show_close_button(value) | +----------+------------------------------+ | *Getter* | is_close_button_visible() | +----------+------------------------------+ ---- .. _class_GraphNode_property_title: - :ref:`String` **title** +----------+------------------+ | *Setter* | set_title(value) | +----------+------------------+ | *Getter* | get_title() | +----------+------------------+ Method Descriptions ------------------- .. _class_GraphNode_method_clear_all_slots: - void **clear_all_slots** **(** **)** Disable all input and output slots of the GraphNode. ---- .. _class_GraphNode_method_clear_slot: - void **clear_slot** **(** :ref:`int` idx **)** Disable input and output slot whose index is 'idx'. ---- .. _class_GraphNode_method_get_connection_input_color: - :ref:`Color` **get_connection_input_color** **(** :ref:`int` idx **)** Returns the color of the input connection 'idx'. ---- .. _class_GraphNode_method_get_connection_input_count: - :ref:`int` **get_connection_input_count** **(** **)** Returns the number of enabled input slots (connections) to the GraphNode. ---- .. _class_GraphNode_method_get_connection_input_position: - :ref:`Vector2` **get_connection_input_position** **(** :ref:`int` idx **)** Returns the position of the input connection 'idx'. ---- .. _class_GraphNode_method_get_connection_input_type: - :ref:`int` **get_connection_input_type** **(** :ref:`int` idx **)** Returns the type of the input connection 'idx'. ---- .. _class_GraphNode_method_get_connection_output_color: - :ref:`Color` **get_connection_output_color** **(** :ref:`int` idx **)** Returns the color of the output connection 'idx'. ---- .. _class_GraphNode_method_get_connection_output_count: - :ref:`int` **get_connection_output_count** **(** **)** Returns the number of enabled output slots (connections) of the GraphNode. ---- .. _class_GraphNode_method_get_connection_output_position: - :ref:`Vector2` **get_connection_output_position** **(** :ref:`int` idx **)** Returns the position of the output connection 'idx'. ---- .. _class_GraphNode_method_get_connection_output_type: - :ref:`int` **get_connection_output_type** **(** :ref:`int` idx **)** Returns the type of the output connection 'idx'. ---- .. _class_GraphNode_method_get_slot_color_left: - :ref:`Color` **get_slot_color_left** **(** :ref:`int` idx **)** const Returns the color set to 'idx' left (input) slot. ---- .. _class_GraphNode_method_get_slot_color_right: - :ref:`Color` **get_slot_color_right** **(** :ref:`int` idx **)** const Returns the color set to 'idx' right (output) slot. ---- .. _class_GraphNode_method_get_slot_type_left: - :ref:`int` **get_slot_type_left** **(** :ref:`int` idx **)** const Returns the (integer) type of left (input) 'idx' slot. ---- .. _class_GraphNode_method_get_slot_type_right: - :ref:`int` **get_slot_type_right** **(** :ref:`int` idx **)** const Returns the (integer) type of right (output) 'idx' slot. ---- .. _class_GraphNode_method_is_slot_enabled_left: - :ref:`bool` **is_slot_enabled_left** **(** :ref:`int` idx **)** const Returns ``true`` if left (input) slot 'idx' is enabled, ``false`` otherwise. ---- .. _class_GraphNode_method_is_slot_enabled_right: - :ref:`bool` **is_slot_enabled_right** **(** :ref:`int` idx **)** const Returns ``true`` if right (output) slot 'idx' is enabled, ``false`` otherwise. ---- .. _class_GraphNode_method_set_slot: - void **set_slot** **(** :ref:`int` idx, :ref:`bool` enable_left, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture` custom_left=null, :ref:`Texture` custom_right=null **)**