
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
@jacekpietal/gstats
Advanced tools
This is a fork of eXponenta's gstatsjs that can be imported as a ES6 module. Additionally, it can be installed from NPM. More informations here.
It also drops support of Pixi v4 in favor of v5.
npm install gstats # for npm users
yarn add gstats # alternatively, for yarn users
Graphics statistics (Texture count, DrawPasses) for WebGL applications. Capability with stats.js
Due to bug of cacheAsBitmap on Graphics on PIXIv4, TextureCounter incorrectly gets the number of textures.
Currently Draw Calls counter can't work on Phaser 3, because Phaser 3 use DrawArrays for rendering WebGL instead DrawElements. Textures amount for Phaser 2 and 3 is relative value, and may be negative.
PIXI Stats.js example - show PIXI game Draw Calls and Textures Count statistics by Stas.js.
Phaser 2 CE Stats.js example - show Phaser 2 CE game Draw Calls and Textures Count statistics by Stas.js.
Textures amount for Phaser is relative value, and may be negative.
Phaser 3 Stats.js example - show Phaser 3 Textures Count statistics by Stas.js.
How i can destroy sprite in Phaser 3 with its texture ?
Currently DC can't work, because Phaser 3 use DrawArrays for rendering WebGL. Textures amount for Phaser3 is relative value, and may be negative.
var app = new PIXI.Application (options);
var pixiHooks = new GStats.PIXIHooks(app);
var stats = new GStats.StatsJSAdapter(pixiHooks);
document.body.appendChild(stats.stats.dom || stats.stats.domElement);
app.ticker.add(stats.update);
var game = new Phaser.Game(options);
var phaserHooks = new GStats.PhaserHooks(game);
var stats = new GStats.StatsJSAdapter(phaserHooks);
document.body.appendChild(stats.stats.dom || stats.stats.domElement);
//or other update function
function update() {
stats.update();
}
coming soon...
var gl = // WebGL2RenderingContext;
var baseHooks = new GStats.BaseHooks();
baseHooks.attach(gl);
var stats = new GStats.StatsJSAdapter(baseHooks);
document.body.appendChild(stats.stats.dom || stats.stats.domElement);
//or other update function
function update() {
stats.update();
}
Go to gstats.d.ts
FAQs
Show DrawCalls, FPS, Texture Count on PIXI, Phaser projects
The npm package @jacekpietal/gstats receives a total of 1,830 weekly downloads. As such, @jacekpietal/gstats popularity was classified as popular.
We found that @jacekpietal/gstats demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.