OverlaySystem.clearLayers¶
Summary¶
OverlaySystem.clearLayers detaches and removes all currently registered layers. It is the bulk reset operation for overlay content while keeping the system alive. After clearing, layerCount becomes zero.
Syntax¶
Parameters¶
This method does not take parameters.
Returns¶
OverlaySystem - The same overlay system instance with no layers.
Type Details¶
Example¶
const canvas = document.querySelector("canvas");
const wgpu = await WasmGPU.create(canvas);
const overlay = wgpu.createOverlay.system();
overlay.addLayer(wgpu.createOverlay.axisTriad());
overlay.addLayer(wgpu.createOverlay.grid());
overlay.clearLayers();
console.log(overlay.layerCount);