🧑🎨 Draws a rectangle or a rounded rectangle.
Also accepts 8 parameters to specify a corner radius for each corner, in the order: top-left, top-right, bottom-right, bottom-left.
x-coordinate
y-coordinate
width of the rectangle
height of the rectangle
Optional
radius for all corners
await Canvas(200);background(0.8);rect(-70, -80, 40, 60);rect(-20, -30, 40, 60, 10);rect(30, 20, 40, 60, 20, 4, 0, 8); Copy
await Canvas(200);background(0.8);rect(-70, -80, 40, 60);rect(-20, -30, 40, 60, 10);rect(30, 20, 40, 60, 20, 4, 0, 8);
🧑🎨 Draws a rectangle or a rounded rectangle.
Also accepts 8 parameters to specify a corner radius for each corner, in the order: top-left, top-right, bottom-right, bottom-left.