Skip to content

drawStatsOverlay

drawStatsOverlay(ctx2d, render, options?): void

Defined in: src/modules/stats/draw-stats-overlay.ts:41

Draws a stats.js-style overlay (numeric readout + frame-time sparkline) for render into ctx2d, in screen-pixel space. Self-contained — saves and restores all context state it touches and assumes no camera transform (call it after any ctx2d.restore() of the world transform).

Renders, per line: fps (cur/avg) + ms (cur/avg/min/max), the 1% / 0.1% lows, an optional logic-ms line, JS heap when performance.memory is available (Chrome only — silently omitted elsewhere), any named counters, then the sparkline with a threshold line at targetMs.

CanvasRenderingContext2D

FrameStats

StatsOverlayOptions = {}

void