Documentation
¶
Overview ¶
Package GraphNode provides methods for working with GraphNode object instances.
Index ¶
- type Advanced
- type Any
- type Implementation
- type Instance
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsContainer() Container.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsGraphElement() GraphElement.Instance
- func (self Instance) AsGraphNode() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) ClearAllSlots()
- func (self Instance) ClearSlot(slot_index int)
- func (self Instance) GetInputPortColor(port_idx int) Color.RGBA
- func (self Instance) GetInputPortCount() int
- func (self Instance) GetInputPortPosition(port_idx int) Vector2.XY
- func (self Instance) GetInputPortSlot(port_idx int) int
- func (self Instance) GetInputPortType(port_idx int) int
- func (self Instance) GetOutputPortColor(port_idx int) Color.RGBA
- func (self Instance) GetOutputPortCount() int
- func (self Instance) GetOutputPortPosition(port_idx int) Vector2.XY
- func (self Instance) GetOutputPortSlot(port_idx int) int
- func (self Instance) GetOutputPortType(port_idx int) int
- func (self Instance) GetSlotColorLeft(slot_index int) Color.RGBA
- func (self Instance) GetSlotColorRight(slot_index int) Color.RGBA
- func (self Instance) GetSlotCustomIconLeft(slot_index int) [1]gdclass.Texture2D
- func (self Instance) GetSlotCustomIconRight(slot_index int) [1]gdclass.Texture2D
- func (self Instance) GetSlotTypeLeft(slot_index int) int
- func (self Instance) GetSlotTypeRight(slot_index int) int
- func (self Instance) GetTitlebarHbox() [1]gdclass.HBoxContainer
- func (self Instance) IgnoreInvalidConnectionType() bool
- func (self Instance) IsSlotDrawStylebox(slot_index int) bool
- func (self Instance) IsSlotEnabledLeft(slot_index int) bool
- func (self Instance) IsSlotEnabledRight(slot_index int) bool
- func (self Instance) OnSlotUpdated(cb func(slot_index int))
- func (self Instance) SetIgnoreInvalidConnectionType(value bool)
- func (self Instance) SetSlot(slot_index int, enable_left_port bool, type_left int, color_left Color.RGBA, ...)
- func (self Instance) SetSlotColorLeft(slot_index int, color Color.RGBA)
- func (self Instance) SetSlotColorRight(slot_index int, color Color.RGBA)
- func (self Instance) SetSlotCustomIconLeft(slot_index int, custom_icon [1]gdclass.Texture2D)
- func (self Instance) SetSlotCustomIconRight(slot_index int, custom_icon [1]gdclass.Texture2D)
- func (self Instance) SetSlotDrawStylebox(slot_index int, enable bool)
- func (self Instance) SetSlotEnabledLeft(slot_index int, enable bool)
- func (self Instance) SetSlotEnabledRight(slot_index int, enable bool)
- func (self Instance) SetSlotTypeLeft(slot_index int, atype int)
- func (self Instance) SetSlotTypeRight(slot_index int, atype int)
- func (self Instance) SetTitle(value string)
- func (self Instance) Title() string
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
[GraphNode] allows to create nodes for a [GraphEdit] graph with customizable content based on its child controls. [GraphNode] is derived from [Container] and it is responsible for placing its children on screen. This works similar to [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 [b]input port[/b] and the right port is referred to as the [b]output port[/b]. 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 [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 [Control]. The properties are grouped by each slot's index in the "Slot" section. [b]Note:[/b] While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that [GraphEdit] uses the port's index and not the slot's index. You can use [method get_input_port_slot] and [method get_output_port_slot] to get the slot index from the port index.
See [Interface] for methods that can be overridden by a [Class] that extends it.
%!(EXTRA string=GraphNode)
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) AsContainer ¶
func (Instance) AsGraphElement ¶
func (self Instance) AsGraphElement() GraphElement.Instance
func (Instance) AsGraphNode ¶
func (Instance) ClearAllSlots ¶
func (self Instance) ClearAllSlots()
Disables all slots of the GraphNode. This will remove all input/output ports from the GraphNode.
func (Instance) ClearSlot ¶
Disables the slot with the given [param slot_index]. This will remove the corresponding input and output port from the GraphNode.
func (Instance) GetInputPortColor ¶
Returns the [Color] of the input port with the given [param port_idx].
func (Instance) GetInputPortCount ¶
Returns the number of slots with an enabled input port.
func (Instance) GetInputPortPosition ¶
Returns the position of the input port with the given [param port_idx].
func (Instance) GetInputPortSlot ¶
Returns the corresponding slot index of the input port with the given [param port_idx].
func (Instance) GetInputPortType ¶
Returns the type of the input port with the given [param port_idx].
func (Instance) GetOutputPortColor ¶
Returns the [Color] of the output port with the given [param port_idx].
func (Instance) GetOutputPortCount ¶
Returns the number of slots with an enabled output port.
func (Instance) GetOutputPortPosition ¶
Returns the position of the output port with the given [param port_idx].
func (Instance) GetOutputPortSlot ¶
Returns the corresponding slot index of the output port with the given [param port_idx].
func (Instance) GetOutputPortType ¶
Returns the type of the output port with the given [param port_idx].
func (Instance) GetSlotColorLeft ¶
Returns the left (input) [Color] of the slot with the given [param slot_index].
func (Instance) GetSlotColorRight ¶
Returns the right (output) [Color] of the slot with the given [param slot_index].
func (Instance) GetSlotCustomIconLeft ¶
Returns the left (input) custom [Texture2D] of the slot with the given [param slot_index].
func (Instance) GetSlotCustomIconRight ¶
Returns the right (output) custom [Texture2D] of the slot with the given [param slot_index].
func (Instance) GetSlotTypeLeft ¶
Returns the left (input) type of the slot with the given [param slot_index].
func (Instance) GetSlotTypeRight ¶
Returns the right (output) type of the slot with the given [param slot_index].
func (Instance) GetTitlebarHbox ¶
func (self Instance) GetTitlebarHbox() [1]gdclass.HBoxContainer
Returns the [HBoxContainer] used for the title bar, only containing a [Label] for displaying the title by default. This can be used to add custom controls to the title bar such as option or close buttons.
func (Instance) IgnoreInvalidConnectionType ¶
func (Instance) IsSlotDrawStylebox ¶
Returns true if the background [StyleBox] of the slot with the given [param slot_index] is drawn.
func (Instance) IsSlotEnabledLeft ¶
Returns [code]true[/code] if left (input) side of the slot with the given [param slot_index] is enabled.
func (Instance) IsSlotEnabledRight ¶
Returns [code]true[/code] if right (output) side of the slot with the given [param slot_index] is enabled.
func (Instance) OnSlotUpdated ¶
func (Instance) SetIgnoreInvalidConnectionType ¶
func (Instance) SetSlot ¶
func (self Instance) SetSlot(slot_index int, enable_left_port bool, type_left int, color_left Color.RGBA, enable_right_port bool, type_right int, color_right Color.RGBA)
Sets properties of the slot with the given [param slot_index]. If [param enable_left_port]/[param enable_right_port] is [code]true[/code], a port will appear and the slot will be able to be connected from this side. With [param type_left]/[param 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 [GraphEdit] (see [method GraphEdit.add_valid_connection_type]). Keep in mind that the [GraphEdit] has the final say in accepting the connection. Type compatibility simply allows the [signal GraphEdit.connection_request] signal to be emitted. Ports can be further customized using [param color_left]/[param color_right] and [param custom_icon_left]/[param 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, [param draw_stylebox] can be used to enable or disable drawing of the background stylebox for each slot. See [theme_item slot]. Individual properties can also be set using one of the [code]set_slot_*[/code] methods. [b]Note:[/b] This method only sets properties of the slot. To create the slot itself, add a [Control]-derived child to the GraphNode.
func (Instance) SetSlotColorLeft ¶
Sets the [Color] of the left (input) side of the slot with the given [param slot_index] to [param color].
func (Instance) SetSlotColorRight ¶
Sets the [Color] of the right (output) side of the slot with the given [param slot_index] to [param color].
func (Instance) SetSlotCustomIconLeft ¶
Sets the custom [Texture2D] of the left (input) side of the slot with the given [param slot_index] to [param custom_icon].
func (Instance) SetSlotCustomIconRight ¶
Sets the custom [Texture2D] of the right (output) side of the slot with the given [param slot_index] to [param custom_icon].
func (Instance) SetSlotDrawStylebox ¶
Toggles the background [StyleBox] of the slot with the given [param slot_index].
func (Instance) SetSlotEnabledLeft ¶
Toggles the left (input) side of the slot with the given [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the left side and the slot will be able to be connected from this side.
func (Instance) SetSlotEnabledRight ¶
Toggles the right (output) side of the slot with the given [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the right side and the slot will be able to be connected from this side.
func (Instance) SetSlotTypeLeft ¶
Sets the left (input) type of the slot with the given [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.
func (Instance) SetSlotTypeRight ¶
Sets the right (output) type of the slot with the given [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs.