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

    A rectangle positioned and sized in world units. More...

    Import Statement: import Clayground.Canvas
    Inherited By:

    MoveTo and Sandbox

    Detailed Description

    Rectangle extends Qt Quick's Rectangle to work with ClayCanvas world coordinates. Position and size are specified in world units, automatically transformed to screen coordinates.

    Example usage:

    import Clayground.Canvas as Canv
    
    Canv.Rectangle {
        canvas: myCanvas
        xWu: 5; yWu: 3
        widthWu: 2; heightWu: 1
        color: "red"
    }

    Properties

    The parent canvas for coordinate transformation. Required.

    X position in world units.

    Y position in world units.

    Width in world units.

    Height in world units.