Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
add mini stats
  • Loading branch information
epreston committed Aug 31, 2023
1 parent 76278c3 commit 8f03901
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import './base.css';
import * as pc from 'playcanvas';
import { MiniStats } from '../node_modules/playcanvas/build/playcanvas-extras.mjs/mini-stats/mini-stats.js';

// create a canvas element at the app location
const canvas = document.createElement('canvas');
Expand All @@ -16,6 +17,10 @@ app.setCanvasResolution(pc.RESOLUTION_AUTO);
// ensure canvas is resized when window changes size
window.addEventListener('resize', () => app.resizeCanvas());

// show mini stats
const miniStats = new MiniStats(app);
miniStats.enabled = true;

// create box entity
const box = new pc.Entity('cube');
box.addComponent('model', {
Expand Down

0 comments on commit 8f03901

Please sign in to comment.