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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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