Skip to content

OverlaySystem.destroy

Summary

OverlaySystem.destroy tears down update scheduling, event subscriptions, and all registered layers, then removes the overlay root element. Call this during app cleanup or when replacing an overlay system entirely.

Syntax

OverlaySystem.destroy(): void
overlay.destroy();

Parameters

This method does not take parameters.

Returns

void - No value is returned; overlay resources and DOM nodes are released.

Type Details

// No additional descriptor expansion is required for this signature.

Example

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

const overlay = wgpu.createOverlay.system();
overlay.addLayer(wgpu.createOverlay.axisTriad());
overlay.destroy();

See Also