Library independence.
See original GitHub issueCurrently anime.js creates it’s own animation loop with requestAnimationFrame
, which makes it undesirable to add anime.js to an existing project that has it’s own loop in which it produces it’s own time stamps.
For example, suppose we have a game that makes it’s own loop (with requestAnimationFrame
, or something else in some other JS engine…). In order for anime.js to be integrated into that custom loop, it would be nice for anime.js API to accept a timestamp that was created outside of anime.js.
For a real-world example of an API that is independent in this fashion and can be placed into any existing animation/game loop, see Tween.js. Note in particular the .update()
method of the Tween
class.
But! it would also be nice if the anime.js API was able use requestAnimationFrame
in cases where the developer doesn’t already have their own loop. That’s something both anime.js and tween.js don’t do yet, which would be nice (having both forms of API for both crowds somehow)!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:6 (1 by maintainers)
Understand that this is closed, but this would be an excellent feature, I’m currently using
anime
in mythreejs
powered game engine but I am about to consolidate all raf calls into the game loop and, if I understand correctly, this is impossible withanime
. A real shame because I wouldn’t like to drop anime if I didn’t have to. Once I do the consolidation I’ll have a look under the hood and see what I can do.Working on A-Frame, a WebVR framework. Just looking for a way to hook into the existing game loop (without introducing anime into the core library), and a way for anime to not create any
requestAnimationFrame
s. Like tween’s globalTWEEN.tick
method.Thanks for the library though! It exploded. If I get around to it, I can see if I can help out.