Struct GraphNode

A GraphNode is a container with potentially several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types.

struct GraphNode ;

A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes refered to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any Control-derived child node to it. After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. In the Inspector you can enable (show) or disable (hide) slots. By default all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections.

Properties

NameTypeDescription
comment[get, set] boolIf true, the GraphNode is a comment node.
offset[get, set] Vector2The offset of the GraphNode, relative to the scroll offset of the GraphEdit. Note: You cannot use position directly, as GraphEdit is a Container.
overlay[get, set] GraphNode.OverlaySets the overlay shown above the GraphNode. See overlay.
resizable[get, set] boolIf true, the user can resize the GraphNode. Note: Dragging the handle will only emit the resizeRequest signal, the GraphNode needs to be resized manually.
selected[get, set] boolIf true, the GraphNode is selected.
showClose[get, set] boolIf true, the close button will be visible. Note: Pressing it will only emit the closeRequest signal, the GraphNode needs to be removed manually.
title[get, set] StringThe text displayed in the GraphNode's title bar.

Methods

NameDescription
_guiInput
clearAllSlots Disables all input and output slots of the GraphNode.
clearSlot Disables input and output slot whose index is idx.
getConnectionInputColor Returns the color of the input connection idx.
getConnectionInputCount Returns the number of enabled input slots (connections) to the GraphNode.
getConnectionInputPosition Returns the position of the input connection idx.
getConnectionInputType Returns the type of the input connection idx.
getConnectionOutputColor Returns the color of the output connection idx.
getConnectionOutputCount Returns the number of enabled output slots (connections) of the GraphNode.
getConnectionOutputPosition Returns the position of the output connection idx.
getConnectionOutputType Returns the type of the output connection idx.
getOffset
getOverlay
getSlotColorLeft Returns the color set to idx left (input) slot.
getSlotColorRight Returns the color set to idx right (output) slot.
getSlotTypeLeft Returns the (integer) type of left (input) idx slot.
getSlotTypeRight Returns the (integer) type of right (output) idx slot.
getTitle
isCloseButtonVisible
isComment
isResizable
isSelected
isSlotEnabledLeft Returns true if left (input) slot idx is enabled, false otherwise.
isSlotEnabledRight Returns true if right (output) slot idx is enabled, false otherwise.
setComment
setOffset
setOverlay
setResizable
setSelected
setShowCloseButton
setSlot Sets properties of the slot with ID idx. If enable_left/right, a port will appear and the slot will be able to be connected from this side. type_left/right is an arbitrary type of the port. Only ports with the same type values can be connected. color_left/right is the tint of the port's icon on this side. custom_left/right is a custom texture for this side's port. Note: This method only sets properties of the slot. To create the slot, add a Control-derived child to the GraphNode.
setTitle

Enums

NameDescription
Constants
Overlay