Skip to content

Rectangles

Rect Screenshot

Overview

You can draw rectangles to your game's canvas using the rect! macro.

API

rect!

Draws rectangles.

rect!(
    w = u32,
    h = u32,
    x = i32,
    y = i32,
    color = u32,
    rotation = i32,
    border_size = u32,
    border_color = u32,
    border_radius = u32,
    fixed = bool,
    bounds = Bounds,
)
ParamTypeDefaultDescription
wu320Width of the rectangle in pixels.
hu320Height of the rectangle in pixels.
xi320X position of the left side of the rectangle in pixels.
yi320Y position of the top side of the rectangle in pixels.
coloru320xffffffffColor that fills the rectangle as RGBA hex.
rotationi320Degrees of rotation. Positive clockwise. Negative counter-clockwise.
border_sizei320Border width in pixels.
border_coloru320x000000Border color as RGBA hex.
border_radiusu320Border radius in pixels.
fixedboolfalseIf true, the rectangle's size and position are unaffected by the camera.
boundsBoundsSets the x, y, w, h of the rectangle.