Rectangles
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,
)
Param | Type | Default | Description |
---|---|---|---|
w | u32 | 0 | Width of the rectangle in pixels. |
h | u32 | 0 | Height of the rectangle in pixels. |
x | i32 | 0 | X position of the left side of the rectangle in pixels. |
y | i32 | 0 | Y position of the top side of the rectangle in pixels. |
color | u32 | 0xffffffff | Color that fills the rectangle as RGBA hex. |
rotation | i32 | 0 | Degrees of rotation. Positive clockwise. Negative counter-clockwise. |
border_size | i32 | 0 | Border width in pixels. |
border_color | u32 | 0x000000 | Border color as RGBA hex. |
border_radius | u32 | 0 | Border radius in pixels. |
fixed | bool | false | If true , the rectangle's size and position are unaffected by the camera. |
bounds | Bounds | Sets the x , y , w , h of the rectangle. |