Closed holiber closed 7 years ago
This isn't currently possible. Multiple Ticker instances are on our roadmap though.
You can however set a framerate on any MovieClip or Sprite to get the speed you want.
There is multiple Ticker support in an internal ES6 branch that is in progress (currently private). Leaving this note here to remind @tehvgg/@gskinner to look at a solution for specifying a Ticker on a specific Tween.
@holiber - can you provide more insight into why you are using two different timer mechanisms?
@gskinner I have many WebGL scenes that use TweenJS on a page. One of them is detail scene and other are preview scenes. Detail scene must render animations as fast as possible but preview scene must render animations only once per second by performance reason.
Usually rendering the stage is the vast majority of the performance cost. Unless the actual tweens are really expensive, I'd consider just adding a bit of code to only update the preview stages every second. You could even do this using tween potentially:
createjs.Tween.get().wait(1000).call(updatePreviewStages);
If you did want to throttle the tweens as well, you could pause the preview tweens to remove them from the managed Tween list, and write a small script/class that uses tween.advance(1000)
to advance them every second.
Let me know if that makes sense.
Hi! I have 2 different components on my page. Each of them uses tween.js for animation, but one of them should work with
Ticker.timingMode = Ticker.RAF
and another one should work withTicker.timingMode = Ticker.TIMEOUT
. So as Ticker is a global variable, I have no idea how to implement this. Maybe, it's possible to call ticks manually for each component?