Frequently Asked Questions
Previous
CustomElementRegistry
Next
Introduction
Loading...
Multiple canvases can coexist on the same page, i.e., multiple "parallel worlds" can exist at the same time. However, this is limited by the underlying rendering API, e.g. WebGL only allows up to 8 contexts. example
In this example, we create our own <canvas>
element, which we use to create the canvas.
const $canvas = document.createElement('canvas');$canvas.width = 600;$canvas.height = 500;document.getElementById('container').appendChild($canvas);const canvas = new Canvas({canvas: $canvas,renderer: new CanvasRenderer(),});