As many games and simulations have their own request for animation frame calls that can be core to rendering obj positions frame by frame, it would be nice if I could call GSAP's from our own request frame function. Ideally everything gets a position in a single RAF.
For instance I would love to do this:
function animate(){
requestAnimationFrame(animate);
TweenMax.ticker._tick(true); //call GSAP rfa manually
render()
}
requestAnimationFrame(animate);
TweenMax.ticker.setManualRequestAnimation = true; //set a flag somehow
//now all tween run off from the user defined RAF
TweenMax.to(obj1,1, { x:,y:,z:....
TweenMax.to(obj2,1, { x:,y:,z:....
I do realize there is the ticker event that i can listen to, but I dont want run my entire application based off of GSAP's RAF event. This would mean stop my RAF run tween then turn on my RAF in my own, with multiple tweens. It seems to make sense that GSAP runs off an game animation render loop and not vice versa.
Is there a way to do this?