If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

rect(x, y, width, height, radius)

Draws a rectangle, using the first two coordinates as the top left corner and the last two as the width/height. For alternate ways to position, see rectMode.
Parameters:
NameDescription
xthe x-coordinate of the top left corner
ythe y-coordinate of the top left corner
widththe width of the rectangle
heightthe height of the rectangle
radius(Optional) the radius of the corners, to round the rectangle

Want to join the conversation?

No posts yet.