Skip to content

Scene ​

Whole container of your drawing.

Examples ​

js
import { Scene } from "pencil.js";

const options = {
    fill: "#DDD"
};
const scene = new Scene(document.body, options);
scene.startLoop();

// Later, when not needed anymore
scene.destroy();

The scene can also use an existing canvas: new Scene(myCanvas).

SceneOptions ​

Inherit from OffscreenCanvasOptions.

NameTypeDefaultComment
cursorStringComponent.cursors.defaultCursor on hover

Released under the MIT License.