Jump to content

TweenManager Usage + Pausing


Recommended Posts

I have created 2 TweenManagers using the latest Dev Branch and I pass them through my game as references.


I want my UI to pause gameTweenManager so I can keep the UI working and pause the game.

However, gameTweenManager.pauseAll() does not appear to pause the tweens. 

What is more, gameTweenManager.getAll().length returns zero even though I see my assets being animated. 

A typical usage of these tween managers is (for example dealing a card) like this:

//setup the tween for itvar tween: Phaser.Tween = this._tweenManager.create(card);tween.to({ x: pos.x, y: pos.y }, 1000, Phaser.Easing.Exponential.Out, true, delay + (cardIndex * 100), false, false);

Am I incorrectly using this class? Thanks :D

Link to comment
Share on other sites

Hmm I'd never considered someone using TweenManager like this :) It fails because of this line in Tween.js:

    this._manager = this.game.tweens;
So they're always added to the main tween manager, not the one you created.
Given all the help you've provided with the typescript defs I'm going to add in this feature for you now :) Keep an eye on the commit messages.
Link to comment
Share on other sites


  • Recently Browsing   0 members

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