fngetCanvasContainer(options?: CanvasOptions): HTMLElementReveals the Canvas pane above the console and returns its host element to append a surface to (e.g. a rendering context's DOM canvas). Clears any surface the previous run left behind.
optionsCanvasOptionsoptional- `{ width?, height?, title? }` — width/height in px (defaults: 100% × 480), title sets the pane header.
returnsHTMLElement
fnattachCanvas(title: string, element: HTMLElement): voidConvenience wrapper: reveals the Canvas pane (titled `title`) and appends `element`, stretched to fill it. This is what demos use to surface engine canvas output.
titlestring- Shown in the Canvas pane header.
elementHTMLElement- The surface to attach (typically a canvas element from the engine).
fncloseCanvasContainer(): voidTears down the canvas surface and hides the Canvas pane again.
Folds or unfolds the visible Canvas pane (the surface stays mounted).
fnlog(...args: unknown[]): voidWrites a line to the Console pane (same sink as the global `log`).
...argsunknown[]- Anything — objects are JSON-formatted like the console rows show.
fnrequestFrame(callback: (now: number) => void): numberBooks an animation frame; the id is tracked so a re-run cancels stray frames automatically.
callback(now: number) => void- Called once with the frame timestamp (rAF-based; timeout-emulated in Node).
returnsnumberframe id, for cancelFrame().
fncancelFrame(frameId: number): booleanCancels one pending frame. Returns whether a frame was actually cancelled.
frameIdnumber- Id from requestFrame().
returnsboolean
fncancelAllFrames(): numberCancels every frame this session booked; returns how many were pending.
returnsnumber