Jump to content

Alpha Tween not working as expected


jaymeh
 Share

Recommended Posts

Hi,

I am currently having an issue where my alpha tween on my game isn't working as I expected. I set the tween to happen over 5 seconds however it seems to only take a fraction of the time and ignores the time. Here is my code:

var box = this.game.add.graphics(0,0);
box.alpha = 0.1;

box.moveTo(0, 0);

box.beginFill(0x000000);
box.drawRect(borderSide, borderTop, (this.game.world.width - borderSide * 2), this.game.world.height);
box.endFill();

var fadeTween = this.game.add.tween(box).to({ alpha: 1 }, 5000, "Linear", true);
fadeTween.onComplete.add(this._end_game, this);

You can see my video attached below for an example of this in action.

Thanks,
Jamie

alpha.mp4

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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