Prozi / pixi-stats

WebGL stats (a 2024 version of stats.js + gstats) for pixi.js
MIT License
15 stars 3 forks source link
draw-calls fps frame memory memory-leak monitor pixi-stats textures

pixi-stats

JavaScript Performance Monitor

This class provides an info box that will help you monitor your code performance.

Screenshots

fps.png ms.png mb.png custom.png

Installation

npm install pixi-stats --save

Usage

import { Application, Ticker, UPDATE_PRIORITY } from 'pixi.js';
import { addStats, Stats } from 'pixi-stats';

const app: Application = new Application({});
const stats: Stats = addStats(document, app);
const ticker: Ticker = Ticker.shared;

ticker.add(stats.update, stats, UPDATE_PRIORITY.UTILITY);
div#stats {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 500;
  width: max(200px, 10vw, 10vh);
  height: max(100px, 6vh, 6vw);
  opacity: 0.8;
  user-select: none;
}

Contributors

The credit goes to:

License

MIT

You can buy me a coffee

https://paypal.me/jacekpietal