Scene.createShapeLayer
Creates a new shape layer
Scene.createShapeLayer() method
Creates a new shape layer
Signature:
createShapeLayer(opts?: LayerCreateOptions): ShapeLayer;Parameters
Parameter | Type | Description |
|---|---|---|
opts | (Optional) Options for creating the shape layer |
Returns:
The newly created shape layer
Example
// Create a shape layer at position (100, 100)
const shapeLayer = scene.createShapeLayer({ position: { x: 100, y: 100 } });
// Create a rectangle shape in the shape layer
const rectangle = shapeLayer.createRectangle({
position: { x: 0, y: 0 },
size: { width: 200, height: 100 },
roundness: 10,
});Last updated: August 5, 2026 at 11:47 AMEdit this page