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¶
Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
root |
HTMLDivElement |
Yes | Overlay root where grid DOM nodes are allocated. |
Returns¶
void - No return value.
Type Details¶
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