Skip to content

Shape

Vector geometric shape widget supporting rectangles, rounded rectangles, circles, ovals, and strokes.

Overview

Shape draws geometric 2D primitives using hardware-accelerated shaders. Supports filled or stroked rectangles, rounded corners, ellipses, and circles with customizable border widths.

Circle Shape

Shape badge = new Shape()
        .type(Shape.Type.CIRCLE)
        .color(Color.GREEN)
        .stroke(false);

API

Shape::color(ColorView)

Shape Color

Returns or sets fill or stroke color of shape.

Parameter Type Description
color ColorView —

Returns Shape.

Shape::stroke(boolean)

Stroke Mode

Configures whether shape is rendered as an outline stroke or solid fill.

Parameter Type Description
stroke boolean —

Returns Shape.

Shape::strokeWidth(float)

Stroke Width

Returns or sets outline stroke line thickness.

Parameter Type Description
strokeWidth float —

Returns Shape.

Shape::type(Type)

Shape Type

Returns or sets geometric primitive type.

Parameter Type Description
type Type —

Returns Shape.