Skip to content

createOverlay.system#canvas

Summary

createOverlay.system#canvas returns the HTML canvas associated with this overlay system. It is the projection reference for viewport size and screen-space mapping.

Syntax

OverlaySystem.canvas: HTMLCanvasElement
const canvas = overlay.canvas;

Parameters

This property does not take parameters.

Returns

HTMLCanvasElement - Canvas bound to this overlay system.

Example

const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);

const overlay = wgpu.createOverlay.system();
console.log(overlay.canvas === canvas);

See Also