Jump to content

Tweens


dthrasher90
 Share

Recommended Posts

The question it's not very clear - you want to start a tween on a button click and then have another tween start after it? If that's the case you should check out chain tweens or combined tweens - the example page on tweens covers lots of scenarios and you should also check out the tween api section.

Link to comment
Share on other sites

7 hours ago, dthrasher90 said:

You add the tween on the button.  Say the user has four or five different options, he could select one and then execute it

You can do something like this on first button click. Notice the last parameter is set to false which ensures tween does not automatically execute.

 var tween = game.add.tween(sprite).to({ alpha: 0 }, 2000, "Linear", false);

In second button click you can simply call tween.start() to start the tween.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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