ShapeContainerMixin.createPolygon

Creates a new polygon shape in this container

ShapeContainerMixin.createPolygon() method

Creates a new polygon shape in this container

Signature:

createPolygon(opts?: PolygonOptions): Polygon;

Parameters

Parameter

Type

Description

opts

PolygonOptions

(Optional) Optional configuration for the polygon

Returns:

Polygon

The newly created polygon

Example

// Create a polygon shape
const polygon = await layer.createPolygon({
  position: { x: 100, y: 100 },
  points: 5,
  innerRadius: 25,
  outerRadius: 50,
});
Last updated: August 5, 2026 at 11:47 AMEdit this page