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

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

    Import Statement: import Clayground.Canvas
    Inherited By:

    CardFocusRing, Compass, FlowChip, HintBar, LabBanner, LabPanel, MoveTo, Narrator, ParamPanel, Plot2D, Sandbox, ThemeSwitch, TransportChip, WatchChip, and WorldLabel

    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.