Reference createShape()

createShape()

This API is experimental

Its behavior may change in a future version of p5.js.

Creates a new p5.ShapeCollection instance.

Use this when you need fine-grained control over when recording starts and stops. Call begin() to start capturing drawing commands and end() to stop. For a simpler callback-based API, use buildShape().

Examples

Syntax

createShape()

Parameters

Returns

p5.ShapeCollection: a new, empty recorded shape container.

Related References