# XWUIGameFPSProfiler

A compact in-engine performance overlay that pins to a screen corner and shows the live `fps` counter, `frameTime` in ms, an SVG sparkline of FPS history, draw-call and triangle counters, and memory usage in MB. Use it to watch frame budget while a scene runs: pump per-frame stats through `update({ fps, frameTime, drawCalls, triangles, memory })`, which updates each value in place and scrolls the sparkline. Choose the corner with `position`, size the graph with `graphWidth`, and trim sections via the `showGraph`, `showDrawCalls`, and `showMemory` config flags.

## Basic Usage

Mounts the overlay with defaults, so it renders pinned `top-right` showing 60 FPS, 16.7ms frame time, and zeroed draw/triangle/memory readouts until stats are pushed.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: A top-right FPS overlay showing 60 FPS and 16.7ms with zeroed draw call, triangle, and memory counters.
```

## Spike Trace

A captured frame-time spike where FPS drops into the 30s with a jagged history and heavy draw/triangle load.

```example
file: examples/SpikeTrace.ts
html: examples/SpikeTrace.html
title: Spike Trace
description: A bottom-left overlay at 34 FPS / 29.4ms with a wider sparkline showing the dip and a spiking draw call count.
```

## Minimal Counter

A stripped-down FPS-only overlay with the graph, draw call, and memory sections hidden.

```example
file: examples/MinimalCounter.ts
html: examples/MinimalCounter.html
title: Minimal Counter
description: A top-left heads-up counter showing only the 144 FPS and 6.9ms rows with every optional section disabled.
```

```api
```
