Skip to content

Instantly share code, notes, and snippets.

@ivanpopelyshev
Created August 4, 2017 12:26
Show Gist options
  • Save ivanpopelyshev/91b04d1e60c7d76b55862c38d6649340 to your computer and use it in GitHub Desktop.
Save ivanpopelyshev/91b04d1e60c7d76b55862c38d6649340 to your computer and use it in GitHub Desktop.
Possible solution for GSAP/tweenlite and pixi integration
PIXI.Ticker.prototype._requestIfNeeded = function()
{
if (!this.gsapTick) {
//do a research, where is the passed time
this.lastTime = performance.now();
this.gsapTick = (event) => { this.update(MILLISECONDS_PASSED_IN_EVENT_I_DONT_KNOW) };
//do a research how to call it after all the other listeners
TweenLite.ticker.addEventListener("tick", this.gsapTick);
}
}
PIXI.Ticker.prototype._cancelIfNeeded = function()
_cancelIfNeeded()
{
if (this.gsapTick)
{
TweenLite.ticker.removeEventListener("tick", this.gsapTick);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment