Skip to content

Connections

bandinopla edited this page Mar 30, 2025 · 1 revision

The editor handles the connection by adding or removing objects from it's connections property. This is an array of {from, to} where to can be an IOutlet or a Vector2Like ( in case that the connection is folowing the mouse )

This property is a special ConnectionsArray proxy like class that handles the connect/disconnect automatically when adding or removing items from the array or doing other modifications to it.

IOutlet

An outlet is a LayoutElement that implements this interface, and that tells the editor where the outlet's position coordinates are and to whom it is connected, so it can draw the connection pipes. Outlets have a connectedTo that will point to another outlet. That way outlets are connected to each other, and outlets also have a reference to the node to which they belong to vía owner

Available outlets

When rendering, some outlets might appear or disappear based on layout logic. A node will regenerate a list of all the rendered outlets on the last draw call by calling it's recalculateOutlets() (TODO: handle the case of an outlet not rendered but connection still active)

Clone this wiki locally