PShape

Data / Composite

Description

Datatype for storing shapes. Load with loadShape() or build programmatically with createShape().

Syntax

PShape* s = loadShape("file.svg") PShape s = createShape()

Parameters

None

Returns

PShape

Methods

getChild(int i)Get child shape by index
getChild(std::string name)Get child shape by name/id
getChildCount()Number of children
getVertex(int i)Get vertex by index as PVector
getVertexCount()Number of vertices
setVertex(int i, float x, float y)Set vertex position
disableStyle()Ignore the shape's own fill/stroke
enableStyle()Use the shape's own fill/stroke
setFill(float r, float g, float b)Set fill color
setStroke(float r, float g, float b)Set stroke color
widthBounding box width
heightBounding box height

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...