Performance monitoring

This plug-in is implemented using stat.js and will display performance information at the specified location image.png image.png image.png

Install

With NPM

  1. npm i @eva/plugin-stats

In Browser

  1. <script src="https://unpkg.com/@eva/plugin-stats@1.2.x/dist/EVA.plugin.stats.min.js"></script>

Usage

  1. import {StatsSystem} from '@eva/plugin-stats'
  2. const game = new Game({
  3. autoStart: true, // optional
  4. frameRate: 60,
  5. })
  6. game.addSystem(new StatsSystem({
  7. show: true // Whether to display or not is set here, it will not run if set to false.
  8. style: {// The values here are all width to percentage vw units
  9. x: 0,
  10. y: 50,
  11. width: 20,
  12. height: 12
  13. }
  14. }))