Jump to content

Can you force a tween to complete? Not just stop.


Recommended Posts

Is it possible that when we call tween.stop() that we can have the tween jump to the end/complete the tween?

Further more can we be able to jump to the end of the following chained tween(s)?

In this case I have a tween to scale up chained with a tween to scale back to normal. Wish we had a Tween.fromTo(obj, param.from, param to, ...). However I need to be able to handle the edge case that if the tween needs to be stopped that the object being tweened can be left in a state it should have been if the tween played out to the end. forceCompletion.

I understand that I could write an onComplete and fire it with a tween.stop(true) and then force the object to the set params I wanted but this gets redundant and slow to write this into every possible tween created for edge cases. However in this case if TweenA (scaling up) has an onComplete just encase to reset params. Then that onComplete will fire prier to the chained TweenB (scale down) which then will cause the Tween to skip the effects of scaling down because on onComplete I have already reset the params.

Suppose this has already been requested as well but how about the tweenManager having a getTweens(obj) which can check the list of tweens for any tweens effecting the object in question and return it in an array?


Update: I've updated my phaser library from 2.4.4 to 2.4.6 and tween.stop(true); does fire the next chained tween in this case TweenB the scale down tween. Which then needs it's own tween.stop();

it is possible to tweenA.stop(true); tweenB.stop(true); and have an onComplete of tweenB to reset the values if I once again submit to having to record and set the desired params of the final desired state.

Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...