need help , this qusetion is about fps in pixi.js
See original GitHub issue var stats = new Stats()
document.body.appendChild( stats.dom );
var app = new PIXI.Application();
var renderer = PIXI.autoDetectRenderer(window.innerWidth,window.innerHeight);
document.getElementById('stage').appendChild(renderer.view);
var stage = new PIXI.Container();
let sprite = new PIXI.Sprite.fromImage('circlef.png');
stage.addChild(sprite)
function update (){
requestAnimationFrame(update)
sprite.x +=1
renderer.render(stage)
stats.update()
}
update()
i set the renderer full of screen , when the screen is large , the fps only have 30 - 33 fps ,but when the screen is small ,the fps can make to 60 fps , why?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
need help , this qusetion is about fps in pixi.js #4160 - GitHub
i set the renderer full of screen , when the screen is large , the fps only have 30 - 33 fps ,but...
Read more >Show fps on screen - Pixi.js - HTML5 Game Devs Forum
Is there a simple way to show fps in PIXI.js? ... Time your animation loop and display it anyway you want. ... Hope...
Read more >javascript - PixiJS - Setting a Fixed Frame Rate - Stack Overflow
JS Ticker uses requestAnimationFrame which will always run at the refresh rate of your monitor (probably 60 fps). If you want 25 then...
Read more >Render Loop - PixiJS
The first step is to calculate how much time has elapsed since the last frame, and then call the Application object's ticker callbacks...
Read more >pixi-fps - npm
FPS counter for pixi.js. Latest version: 2.0.1, last published: 4 years ago. Start using pixi-fps in your project by running `npm i ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Small note here about your code. Application auto-updates so you don’t need to setup a new requestAnimationFrame. Your example will render twice per frame (which is expensive). To do the sprite.x += 1 bit do this instead:
app.ticker.add(function() { sprite.x += 1; });
You can also watch FPS this way: app.ticker.FPS
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.