Vector2 ConnectionPosition { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The ConnectionPosition property of the PlugOut class in the Editor.NodeEditor namespace represents the position of the connection point in a 2D space. This property is of type Vector2, which typically contains two float values representing the X and Y coordinates.

Being a virtual property, ConnectionPosition can be overridden in derived classes, allowing for customized behavior or additional logic when determining the connection point's position.

Usage

To use the ConnectionPosition property, you can access it directly from an instance of the PlugOut class or any derived class. This property is useful when you need to determine or set the exact position where a connection should be made in a node editor interface.

Example usage:

  • Retrieve the current connection position to align other UI elements or to perform hit-testing.
  • Override the property in a subclass to provide a custom connection position logic based on specific criteria or conditions.

Example

// Example of accessing the ConnectionPosition property
PlugOut plugOut = new PlugOut();
Vector2 position = plugOut.ConnectionPosition;

// Example of overriding the ConnectionPosition property in a derived class
public class CustomPlugOut : PlugOut
{
    public override Vector2 ConnectionPosition
    {
        get
        {
            // Custom logic to determine the connection position
            return new Vector2(100, 200);
        }
    }
}