GithubHelp home page GithubHelp logo

Get all Tweens at once about tweenjs HOT 3 CLOSED

zogs avatar zogs commented on August 14, 2024
Get all Tweens at once

from tweenjs.

Comments (3)

zogs avatar zogs commented on August 14, 2024 1

Very nice ! TweenGroup looks great :)

Thank you very much, i'll try it

from tweenjs.

lannymcnie avatar lannymcnie commented on August 14, 2024

There is currently no internal way to do this in 1.0. You can easily add/remove the tweens from a managed list yourself, which is pretty straightforward.

There is a new TweenGroup class available in GitHub (not rolled into an official release yet). Might be worth pulling down the NEXT version and trying it out. It has a timeSync. Here are the docs:

TweenGroup allows you to pause and time scale a collection of tweens or timelines. For example, this could be used to stop all tweens associated with a view when leaving that view.

myView.tweens = new createjs.TweenGroup();
myView.tweens.get(spinner, {loop: -1}).to({rotation:360}, 500);
myView.tweens.get(image).to({alpha: 1}, 5000);

// ... make all tweens in this view run in slow motion:
myView.tweens.timeScale = 0.1;

// ... pause all this view's active tweens:
myView.tweens.paused = true; // stop all tweens.

You can add a group to another group to nest it.

viewTweenGroup.add(buttonTweenGroup);

Tweens are automatically removed from the group when they complete (ie. when the complete event fires).

from tweenjs.

lannymcnie avatar lannymcnie commented on August 14, 2024

Closing this for now. Feel free to re-open or follow up if TweenGroup doesn't work for you.

from tweenjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.