shape()

Shape / Loading & Displaying

Description

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

NameTypeDescription
sPShapethe shape to draw
xfloatx-coordinate
yfloaty-coordinate
wfloatwidth (optional)
hfloatheight (optional)

Returns

void

Related

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); }