rect()

Shape / 2D Primitives

Description

Draws a rectangle to the screen. The fourth parameter can be a corner radius.

Syntax

void rect(float x, float y, float w, float h) void rect(float x, float y, float w, float h, float r)

Parameters

NameTypeDescription
xfloatx-coordinate of the upper-left corner
yfloaty-coordinate of the upper-left corner
wfloatwidth
hfloatheight
rfloatcorner radius (optional)

Returns

void

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...