a port of the Processing Visualization Language
Name

rectMode()

Examples
example pic
rectMode(CENTER);

rect(35, 35, 50, 50);

rectMode(CORNER);

fill(102);

rect(35, 35, 50, 50);
Description Modifies the location from which rectangles draw. The default mode is rectMode(CORNER), which specifies the location to be the upper left corner of the shape and uses the third and fourth parameters of rect() to specify the width and height. The syntax rectMode(CORNERS) uses the first and second parameters of rect() to set the location of one corner and uses the third and fourth parameters to set the opposite corner. The syntax rectMode(CENTER) draws the image from its center point and uses the third and forth parameters of rect() to specify the image's width and height. The syntax rectMode(RADIUS) draws the image from its center point and uses the third and forth parameters of rect() to specify half of the image's width and height. The parameter must be written in "ALL CAPS" because Processing is a case sensitive language. Note: In version 125, the mode named CENTER_RADIUS was shortened to RADIUS.
Syntax
rectMode(MODE)
Parameters
MODE Either CORNER, CORNERS, CENTER, or RADIUS
Usage Web & Application
Related rect()

This reference is licensed under the CC BY-NC-SA 2.0 license:

Creative Commons License
Fork me on GitHub