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.

Member Functions

void clear_all_slots ( )
void clear_slot ( int idx )
Color get_connection_input_color ( int idx )
int get_connection_input_count ( )
Vector2 get_connection_input_pos ( int idx )
int get_connection_input_type ( int idx )
Color get_connection_output_color ( int idx )
int get_connection_output_count ( )
Vector2 get_connection_output_pos ( int idx )
int get_connection_output_type ( int idx )
Vector2 get_offset ( ) const
int get_overlay ( ) const
Color get_slot_color_left ( int idx ) const
Color get_slot_color_right ( int idx ) const
int get_slot_type_left ( int idx ) const
int get_slot_type_right ( int idx ) const
String get_title ( ) const
bool is_close_button_visible ( ) const
bool is_comment ( ) const
bool is_resizeable ( ) const
bool is_selected ( )
bool is_slot_enabled_left ( int idx ) const
bool is_slot_enabled_right ( int idx ) const
void set_comment ( bool comment )
void set_offset ( Vector2 offset )
void set_overlay ( int overlay )
void set_resizeable ( bool resizeable )
void set_selected ( bool selected )
void set_show_close_button ( bool show )
void set_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 )
void set_title ( String title )

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.

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.

Member Function Description

  • 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 )

Return the color of the input connection ‘idx’.

  • int get_connection_input_count ( )

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

Return the position of the input connection ‘idx’.

  • int get_connection_input_type ( int idx )

Return the type of the input connection ‘idx’.

  • Color get_connection_output_color ( int idx )

Return the color of the output connection ‘idx’.

  • int get_connection_output_count ( )

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

Return the position of the output connection ‘idx’.

  • int get_connection_output_type ( int idx )

Return the type of the output connection ‘idx’.

Return the offset of the GraphNode.

  • int get_overlay ( ) const
  • Color get_slot_color_left ( int idx ) const

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

  • Color get_slot_color_right ( int idx ) const

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

  • int get_slot_type_left ( int idx ) const

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

  • int get_slot_type_right ( int idx ) const

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

Return the title of the GraphNode.

  • bool is_close_button_visible ( ) const

Returns true if the close button is shown. False otherwise.

  • bool is_comment ( ) const
  • bool is_resizeable ( ) const
  • bool is_selected ( )
  • bool is_slot_enabled_left ( int idx ) const

Return true if left (input) slot ‘idx’ is enabled. False otherwise.

  • bool is_slot_enabled_right ( int idx ) const

Return true if right (output) slot ‘idx’ is enabled. False otherwise.

  • void set_comment ( bool comment )
  • void set_offset ( Vector2 offset )

Set the offset of the GraphNode.

  • void set_overlay ( int overlay )
  • void set_resizeable ( bool resizeable )
  • void set_selected ( bool selected )
  • void set_show_close_button ( bool show )

Show the close button on the GraphNode if ‘show’ is true (disabled by default). If enabled, a connection on the signal close_request is needed for the close button to work.

  • void set_title ( String title )

Set the title of the GraphNode.