Search code examples
createjstimelinetweenjs

How to use the Timeline in tweenjs


Docu says:

Timeline The Timeline class synchronizes multiple tweens and allows them to be controlled as a group.

but there is no example how to use it. If I create a Timeline with

var tl = createjs.Timeline();

none of the shapes are rendered anymore.

Timeline is a great feature in TweenMax and I like to use it in the canvas too.


Solution

  • Creating a Timeline shouldn't affect the rendering of the Shapes - could you provide some more code or explain further what you're trying to do?

    The usage of Timeline is quite straight forward:

        var timeline = new createjs.Timeline(); //create the Timeline
        timeline.addTween(tween, tween2); // add some tweens
        timeline.setPaused(true); // pause all tweens 
        timeline.setPosition(300); // set position on all tweens ...
    

    However if you're more used to GSAP you could just use GSAP in combination with EaselJS/CreateJS - they work great together.