rectMode()
Set how the (x, y) and size arguments of rect() / square() are interpreted.
CORNER(default):(x, y)is the top-left corner;w/hare the width/height.CORNERS:(x, y)and(w, h)are two opposite corners of the rectangle.CENTER:(x, y)is the center;w/hare the width/height.RADIUS:(x, y)is the center;w/hare half the width/height.
Follows rectMode() in p5.js. Resets to CORNER at the start of each fabDraw();
scope a change with push() / pop().
Parameters
| Name | Type | Description |
|---|---|---|
mode | string | CORNER, CORNERS, CENTER, or RADIUS. |
Examples
Syntax
fab.rectMode(mode)