Saeki Amae Posted August 9, 2020 Share Posted August 9, 2020 Hi all! I'm still new to Pixi and I would like to understand such thing - what differs using pixi ticker from just having infinite loop and calling Renderer.render(stage) each time in it? Quote Link to comment Share on other sites More sharing options...
themoonrat Posted August 9, 2020 Share Posted August 9, 2020 Short answer. Not much. Slightly longer answer: the Ticker class uses requestAnimation to do the looping, just as would be recommended if handling calling render yourself. It just handles some edge cases with ordering and timing when adding and removing things to this rAF callback, adds a bit of useful information, like a delta, and lets you control the minfps / maxfps and speed of the ticker. There is nothing wrong with not using it at all. But what it contains are the kind of things you may start to realise are useful as you progress rafaeldasmerces and Saeki Amae 2 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 9, 2020 Share Posted August 9, 2020 You can make your own rAF loop https://github.com/pixijs/pixi.js/wiki/v5-Custom-Application-GameLoop Ticker has priorities for listeners and handy things like "deltaMS = min(deltaMS, 100)" that save your app when the tab is switched. You can learn that knowledge by patching your code many times when something goes wrong, or just use Pixi Ticker https://github.com/pixijs/pixi.js/blob/dev/packages/ticker/src/Ticker.ts#L446 Saeki Amae 1 Quote Link to comment Share on other sites More sharing options...
Saeki Amae Posted August 9, 2020 Author Share Posted August 9, 2020 Ok, thank you for explanation! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.