Created
August 4, 2017 12:26
-
-
Save ivanpopelyshev/91b04d1e60c7d76b55862c38d6649340 to your computer and use it in GitHub Desktop.
Possible solution for GSAP/tweenlite and pixi integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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