This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.
| Name | shape() |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Examples | ![]()
PShape s;
void setup() {
s = loadShape("bot.svg");
}
void draw() {
shape(s, 10, 10, 80, 80);
}
| ||||||||||||||
| Description |
Draws shapes to the display window. Shapes must be in the sketch's "data" directory to load correctly. Select "Add file..." from the "Sketch" menu to add the shape. Processing currently works with SVG shapes only. The shape parameter specifies the shape to display and the x and y parameters define the location of the shape from its upper-left corner. The shape is displayed at its original size unless the c and d parameters specify a different size. The shapeMode() function can be used to change the way these parameters are interpreted.
Note complex shapes may draw awkwardly with P3D. This renderer does not yet support shapes that have holes or complicated breaks. |
||||||||||||||
| Syntax | shape(shape) shape(shape, x, y) shape(shape, a, b, c, d) | ||||||||||||||
| Parameters |
| ||||||||||||||
| Returns | void | ||||||||||||||
| Related | PShape loadShape() shapeMode() |


