Code Monkey home page Code Monkey logo

Comments (4)

 avatar commented on June 23, 2024

Do you only want a subset of the tweens that you put in the GoTweenFlow to
be cancelled/destroyed? Why not destroy the entire GoTweenFlow?

  • Michael

On Mon, Mar 7, 2016 at 4:41 AM, Matthijs Kooijman [email protected]
wrote:

I have a number of related tweens which should run simultaneously and,
sometimes, be canceled halfway collectively. I was hoping to use some kind
of collection (GoTweenFlow seems promising) to manage these tweens, but
AFAICS I can then only pause the tweens, not actually stop / destroy them
through the collection. I would have to keep a separate list of tweens to
call destroy() on, pretty much voiding the goal of the collection.

Am I missing something, or is this something that could/should be added?


Reply to this email directly or view it on GitHub
#76.

from gokit.

matthijskooijman avatar matthijskooijman commented on June 23, 2024

No, I want to destroy them all. Looking at the code, GoTweenFlow does not override destroy(), so that would only make GoAbstractTweenCollection set its state to destroyed, not actually destroy the contained tweens. Though I haven't actually tested this, so I might have missed some bit of the code that makes this work, of course...

from gokit.

 avatar commented on June 23, 2024

So to answer your question, there's a bit of context to give:

The only thing GoKit does with tweens is keep them in a list to update them
every frame.

Whenever you set any AbstractGoTween (which includes GoTween, GoTweenChain
and GoTweenFlow), we just set an internal state in the tween to mark it as
destroyed.

When Go.cs is looping through all running tweens, it will remove that class
from the list of tweens to update every frame.

The reason why you don't need to worry about the internal list of Tweens
for the GoTweenFlow is because the collection keeps track of all those
internal tweens, not the master Go.cs class. Destroying the GoTweenFlow
effectively will destroy the other objects.

In short, whenever you want to remove all the tweens in a GoTweenFlow, just
call destroy() on the GoTweenFlow.

Hope this helps!

  • Michael

On Mon, Mar 7, 2016 at 12:33 PM, Matthijs Kooijman <[email protected]

wrote:

No, I want to destroy them all. Looking at the code, GoTweenFlow does not
override destroy(), so that would only make GoAbstractTweenCollection set
its state to destroyed, not actually destroy the contained tweens. Though I
haven't actually tested this, so I might have missed some bit of the
code that makes this work, of course...


Reply to this email directly or view it on GitHub
#76 (comment).

from gokit.

matthijskooijman avatar matthijskooijman commented on June 23, 2024

Ah, I see. I was assuming that the other subclasses of AbstractGoTween would actually do something to remove themselves from the main list of running tweens in their destroy() methods, but that happens automatically by setting their state to destroyed, right.

Thanks for taking the time to explain, my doubts are answered! I should have just tried, instead of trying to figure out the code first :-p

from gokit.

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.