Skip to main content

rect

Description

Draws a rectangle to the screen. A rectangle is a four-sided closed shape with every angle at ninety degrees. By default, the first two parameters set the location of the upper-left corner, the third sets the width, and the fourth sets the height. The way these parameters are interpreted, may be changed with the rectMode function.

Syntax

rect(x, y, w, h)

Parameters

ParameterDescription
xx-coordinate of the rectangle
yy-coordinate of the rectangle
wwidth of the rectangle
hheight of the rectangle