rectangle

fun rectangle(rectangle: Rectangle)(source)

Draws a rectangle based on the specified properties.

Parameters

rectangle

The Rectangle object containing the x and y coordinates, width, and height of the rectangle.


fun rectangle(x: Double, y: Double, width: Double, height: Double = width)(source)

Draws a rectangle on the canvas based on the provided position and dimensions.

Parameters

x

The x-coordinate of the top-left corner of the rectangle.

y

The y-coordinate of the top-left corner of the rectangle.

width

The width of the rectangle.

height

The height of the rectangle. Defaults to the value of width if not specified.


fun rectangle(corner: Vector2, width: Double, height: Double = width)(source)

Draws a rectangle on the canvas using the specified parameters.

Parameters

corner

The top-left corner of the rectangle represented as a Vector2 object.

width

The width of the rectangle.

height

The height of the rectangle. If not specified, it defaults to the width, creating a square.