This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Core Javadoc and Libraries Javadoc.
| Name | square() |
||||||
|---|---|---|---|---|---|---|---|
| Examples | ![]() square(30, 20, 55); | ||||||
| Description |
Draws a square to the screen. A square is a four-sided shape with every angle at ninety degrees and each side is the same length. By default, the first two parameters set the location of the upper-left corner, the third sets the width and height. The way these parameters are interpreted, however, may be changed with the rectMode() function. |
||||||
| Syntax | square(x, y, extent) | ||||||
| Parameters |
| ||||||
| Returns | void | ||||||
| Related | rect() rectMode() |

