 |
 |
 |
 |
Name |
|
rectMode() |
 |
|
|
Examples |
|
 |
rectMode(CENTER_DIAMETER);
rect(35, 35, 50, 50);
rectMode(CORNER);
fill(102);
rect(35, 35, 50, 50);
|
 |
|
Description |
|
The origin of the rectangle is modified with the rectMode() function. The default rectangle mode is rectMode(CORNER), which specifies the location to be the upper left corner of the shape. The rectMode(CENTER_DIAMETER) function call draws the shape from its center point. With rectMode(CORNERS), the parameters to the rectangle function define the two corners of the shape. The parameter must written in "ALL CAPS" because Processing is a case sensitive language. |
 |
|
|
Syntax |
|
rectMode(MODE)
|
 |
|
|
Parameters |
|
MODE |
|
Either CORNER, CORNERS, CENTER_DIAMETER
|
|
 |
|
|
Returns |
|
None |
 |
|
|
Usage |
|
Web & Application |
 |
|
|
Related |
|
rect() |
|