rect(x, y, w, h);
Draw a rectangle on the screen.
Arguments
x
The x position of the rectangley
The y position of the rectanglew
The widthh
The heightfunction setup()
createWindow(200, 200);
end
function draw()
background('purple');
-- rectangle near the top-left corner
rect(30, 30, 120, 80);
end
Output