{"id":15899148,"url":"https://github.com/prozi/gstats","last_synced_at":"2025-03-22T00:44:11.995Z","repository":{"id":92788871,"uuid":"355030989","full_name":"Prozi/gstats","owner":"Prozi","description":"fork of https://github.com/eXponenta/gstatsjs/","archived":false,"fork":false,"pushed_at":"2024-07-23T23:29:08.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-25T10:28:51.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Prozi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-06T02:20:47.000Z","updated_at":"2024-07-23T23:29:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2f7a093-6736-4298-b0b8-228c7e8018df","html_url":"https://github.com/Prozi/gstats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Fgstats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Fgstats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Fgstats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Prozi%2Fgstats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Prozi","download_url":"https://codeload.github.com/Prozi/gstats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890107,"owners_count":20527031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T10:11:16.699Z","updated_at":"2025-03-22T00:44:11.978Z","avatar_url":"https://github.com/Prozi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gstatsjs\n\nThis is a fork of [eXponenta's gstatsjs](https://github.com/eXponenta/gstatsjs) that can be imported as a ES6 module. Additionally, it can be installed from [NPM](https://www.npmjs.com/package/gstats). More informations [here](https://github.com/eXponenta/gstatsjs/pull/2).\n\nIt also drops support of Pixi v4 in favor of v5.\n\n```sh\n# for npm users\nnpm install @pietal.dev/gstats --save\n# alternatively, for yarn users\nyarn add @pietal.dev/gstats --save\n```\n\nGraphics statistics (Texture count, DrawPasses) for WebGL applications. Capability with [stats.js](https://github.com/mrdoob/stats.js)\n\n# Remarks\n\n~~Due to [bug of cacheAsBitmap on Graphics on PIXIv4](https://github.com/pixijs/pixi.js/issues/4692), TextureCounter incorrectly gets the number of textures.~~\n\nCurrently Draw Calls counter can't work on Phaser 3, because Phaser 3 use DrawArrays for rendering WebGL instead DrawElements.\nTextures amount for Phaser 2 and 3 is relative value, and may be negative.\n\n# Examples\n\n[PIXI Stats.js example](./exampless/pixi) - show PIXI game Draw Calls and Textures Count statistics by [Stas.js](https://github.com/mrdoob/stats.js/).\n\n[Phaser 2 CE Stats.js example](./exampless/phaser2ce) - show Phaser 2 CE game Draw Calls and Textures Count statistics by [Stas.js](https://github.com/mrdoob/stats.js/).\n\nTextures amount for Phaser is relative value, and may be negative.\n\n[Phaser 3 Stats.js example](./exampless/phaser3) - show Phaser 3 Textures Count statistics by [Stas.js](https://github.com/mrdoob/stats.js/).\n\nHow i can destroy sprite in Phaser 3 with its texture ?\n\nCurrently DC can't work, because Phaser 3 use DrawArrays for rendering WebGL.\nTextures amount for Phaser3 is relative value, and may be negative.\n\n# Using\n\n### PIXI \u0026 Stats.js\n\n```javascript\nvar app = new PIXI.Application(options);\nvar pixiHooks = new GStats.PIXIHooks(app);\nvar stats = new GStats.StatsJSAdapter(pixiHooks);\ndocument.body.appendChild(stats.stats.dom || stats.stats.domElement);\napp.ticker.add(stats.update);\n```\n\n### Phaser 2/3 \u0026 Stats.js\n\n```javascript\nvar game = new Phaser.Game(options);\nvar phaserHooks = new GStats.PhaserHooks(game);\nvar stats = new GStats.StatsJSAdapter(phaserHooks);\ndocument.body.appendChild(stats.stats.dom || stats.stats.domElement);\n\n//or other update function\nfunction update() {\n  stats.update();\n}\n```\n\n### PIXI/Phaser \u0026 Show stats in app context\n\ncoming soon...\n\n### Raw WebGL \u0026 Stats.js\n\n```javascript\nvar gl = // WebGL2RenderingContext;\nvar baseHooks = new GStats.BaseHooks();\n    baseHooks.attach(gl);\nvar stats = new GStats.StatsJSAdapter(baseHooks);\n\ndocument.body.appendChild(stats.stats.dom || stats.stats.domElement);\n\n//or other update function\nfunction update() {\n    stats.update();\n}\n```\n\n### TypeScript\n\nGo to [index.d.ts](https://github.com/Prozi/gstats/blob/master/dist/index.d.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozi%2Fgstats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprozi%2Fgstats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprozi%2Fgstats/lists"}