d13 Posted June 3, 2015 Share Posted June 3, 2015 I just noticed that Pixi v3 has a class called `Ticker` http://pixijs.github.io/docs/PIXI.ticker.Ticker.html What does this class do?Is it a wrapper for `requestAnimationFrame`? Any help appreciated! Quote Link to comment Share on other sites More sharing options...
xerver Posted June 3, 2015 Share Posted June 3, 2015 https://github.com/GoodBoyDigital/pixi.js/blob/master/src/core/ticker/Ticker.js#L6-L15/** * A Ticker class that runs an update loop that other objects listen to. * This class is composed around an EventEmitter object to add listeners * meant for execution on the next requested animation frame. * Animation frames are requested only when necessary, * e.g. When the ticker is started and the emitter has listeners. * * @class * @memberof PIXI.ticker */It is used to do the animating of MovieClips, but can be used for anything. It is kind of just a wrapper around requestAnimationFrame, commonly used for having separate loops from the main loop. Quote Link to comment Share on other sites More sharing options...
d13 Posted June 3, 2015 Author Share Posted June 3, 2015 It is kind of just a wrapper around requestAnimationFrame. Is there any advantage to using it as the main loop, instead of `requestAnimationFrame`? Quote Link to comment Share on other sites More sharing options...
xerver Posted June 3, 2015 Share Posted June 3, 2015 Not really no. It gives you stop/start functionality as well as tracking FPS and things like that. But usually for the main loop you don't need those things. Quote Link to comment Share on other sites More sharing options...
d13 Posted June 3, 2015 Author Share Posted June 3, 2015 Not really no.Ok, thanks! 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.