Skip to content

GridLayer.attach

Summary

GridLayer.attach creates and mounts the grid layer container and node pools under the overlay root. This is usually managed by OverlaySystem.addLayer.

Syntax

GridLayer.attach(root: HTMLDivElement): void
layer.attach(root);

Parameters

Name Type Required Description
root HTMLDivElement Yes Overlay root where grid DOM nodes are allocated.

Returns

void - No return value.

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();
const grid = wgpu.createOverlay.grid({ id: "grid-main" });
overlay.addLayer(grid); // attach called internally

See Also