GraphNode

Inherits: Container < Control < CanvasItem < Node < 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

boolcomment
Vector2offset
Overlayoverlay
boolresizable
boolselected
boolshow_close
Stringtitle

Methods

voidclear_all_slots ( )
voidclear_slot ( int idx )
Colorget_connection_input_color ( int idx )
intget_connection_input_count ( )
Vector2get_connection_input_position ( int idx )
intget_connection_input_type ( int idx )
Colorget_connection_output_color ( int idx )
intget_connection_output_count ( )
Vector2get_connection_output_position ( int idx )
intget_connection_output_type ( int idx )
Colorget_slot_color_left ( int idx ) const
Colorget_slot_color_right ( int idx ) const
intget_slot_type_left ( int idx ) const
intget_slot_type_right ( int idx ) const
boolis_slot_enabled_left ( int idx ) const
boolis_slot_enabled_right ( int idx ) const
voidset_slot ( int idx, bool enable_left, int type_left, Color color_left, bool enable_right, int type_right, Color color_right, Texture custom_left=null, Texture custom_right=null )

Theme Properties

StyleBoxbreakpoint
Textureclose
Colorclose_color
intclose_offset
StyleBoxcomment
StyleBoxcommentfocus
StyleBoxdefaultfocus
StyleBoxdefaultframe
StyleBoxframe
Textureport
intport_offset
StyleBoxposition
Textureresizer
StyleBoxselectedframe
intseparation
Colortitle_color
Fonttitle_font
inttitle_offset

Signals

  • close_request ( )

Signal sent on closing the GraphNode.


Signal sent when the GraphNode is dragged.


  • offset_changed ( )

Signal sent when the GraphNode is moved.


  • raise_request ( )

Signal sent when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode.


  • resize_request ( Vector2 new_minsize )

Enumerations

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

Setterset_comment(value)
Getteris_comment()

Setterset_offset(value)
Getterget_offset()

The offset of the GraphNode, relative to the scroll offset of the GraphEdit. Note that you cannot use position directly, as GraphEdit is a Container.


Setterset_overlay(value)
Getterget_overlay()

Setterset_resizable(value)
Getteris_resizable()

Setterset_selected(value)
Getteris_selected()

Setterset_show_close_button(value)
Getteris_close_button_visible()

Setterset_title(value)
Getterget_title()

Method Descriptions

  • void clear_all_slots ( )

Disable all input and output slots of the GraphNode.


  • void clear_slot ( int idx )

Disable input and output slot whose index is ‘idx’.


  • Color get_connection_input_color ( int idx )

Returns the color of the input connection ‘idx’.


  • int get_connection_input_count ( )

Returns the number of enabled input slots (connections) to the GraphNode.


  • Vector2 get_connection_input_position ( int idx )

Returns the position of the input connection ‘idx’.


  • int get_connection_input_type ( int idx )

Returns the type of the input connection ‘idx’.


  • Color get_connection_output_color ( int idx )

Returns the color of the output connection ‘idx’.


  • int get_connection_output_count ( )

Returns the number of enabled output slots (connections) of the GraphNode.


  • Vector2 get_connection_output_position ( int idx )

Returns the position of the output connection ‘idx’.


  • int get_connection_output_type ( int idx )

Returns the type of the output connection ‘idx’.


  • Color get_slot_color_left ( int idx ) const

Returns the color set to ‘idx’ left (input) slot.


  • Color get_slot_color_right ( int idx ) const

Returns the color set to ‘idx’ right (output) slot.


  • int get_slot_type_left ( int idx ) const

Returns the (integer) type of left (input) ‘idx’ slot.


  • int get_slot_type_right ( int idx ) const

Returns the (integer) type of right (output) ‘idx’ slot.


  • bool is_slot_enabled_left ( int idx ) const

Returns true if left (input) slot ‘idx’ is enabled, false otherwise.


  • bool is_slot_enabled_right ( int idx ) const

Returns true if right (output) slot ‘idx’ is enabled, false otherwise.