← Back to Docs
  • index.html
  • Clayground
  • Clayground.Canvas
  • Connector
  • Clayground 2025.2
  • Connector QML Type

    A visual line connecting two items with automatic position tracking. More...

    Import Statement: import Clayground.Canvas

    Detailed Description

    Connector draws a line between the centers of two items and automatically updates when either item moves. Useful for visualizing relationships or connections in diagrams and games.

    Example usage:

    import Clayground.Canvas as Canv
    
    Canv.Connector {
        from: nodeA
        to: nodeB
        color: "green"
        strokeWidth: 3
        style: ShapePath.DashLine
    }

    Properties

    The source item to connect from. Required.

    The target item to connect to. Required.

    Width of the connector line.

    Color of the connector line.

    Style of the line (solid, dash, etc.).

    Custom dash pattern as an array of dash/gap lengths.