Jump to content

Pixi Ticker - why to use?


Saeki Amae
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...