shape()
Shape / Loading & DisplayingDescription
Draws a shape to the display window.
Syntax
void shape(const PShape& s, float x, float y)
void shape(const PShape& s, float x, float y, float w, float h)
Parameters
| Name | Type | Description |
|---|---|---|
| s | PShape | the shape to draw |
| x | float | x-coordinate |
| y | float | y-coordinate |
| w | float | width (optional) |
| h | float | height (optional) |
Returns
voidRelated
Under the Hood
From Processing.h:
void shape(const PShape& s, float x=0, float y=0);
void shape(const PShape& s, float x, float y, float w, float h);
void shape(const PShape* s, float x=0, float y=0) { if(s) shape(*s,x,y); }
void shape(const PShape* s, float x=0, float y=0) { if(s) shape(*s,x,y);
void shape(const PShape* s, float x, float y, float w, float h) { if(s) shape(*s,x,y,w,h); }
void shape(const PShape* s, float x, float y, float w, float h) { if(s) shape(*s,x,y,w,h);
Under the Hood
From Processing.cpp:
void PApplet::shape(const PShape& s,float x,float y) { drawPShape(s,x,y); }
void PApplet::shape(const PShape& s,float x,float y,float w,float h){ drawPShape(s,x,y,w,h); }