UNPKG

webgl-benchmark

Version:

Benchmark WebGL performance using different JavaScript rendering/game engines, such as Pixi and Phaser.

18 lines (14 loc) 573 B
import IScene from './IScene.js'; export default class SpritesSingleTexture extends IScene { constructor(app, gui) { super(app, gui); this.title = 'Sprites: Single Texture'; this.description = 'A single bunny texture is used; this scene should test the basic raw sprite rendering power.' } _create(objectCount) { for (let i = this._children.length; i < objectCount; ++i) { const sprite = this._app.scene.add.sprite(0, 0, 'images/bunny1.png'); sprite.setPosition(Math.random() * this._app.screen.width, Math.random() * this._app.screen.height); } } }