Reference p5.ShapeCollection

p5.ShapeCollection

A container for recorded p5 drawing commands that can be exported as an SVG document or replayed onto the canvas.

Use createShape() or buildShape() to record shapes, or loadSVG() / createSVG() to import external SVGs into a ShapeCollection.

Examples

Syntax

p5.ShapeCollection()

Parameters

Methods

begin

Starts capturing drawing commands into this shape container.

Options:

  • draw (Boolean, optional): If true, drawing commands will be drawn onto the canvas in addition to being recorded. If false (default), commands are recorded silently without rendering.
end
Stops capturing drawing commands and finalizes the shape.

Related References