Jump to content

Energy Bars


ctran13
 Share

Recommended Posts

Hello,

 

I've been looking through the documentations and forums but couldn't find anything for this and maybe was wondering if there was an easier way to do this.

 

Basically, I'm making an Energy Bar (well, more like orbs ala Health and Mana from Diablo) and I was wondering if there was a way to clip an image in the same way as the progress bar.  My workaround would be creating an alpha channel and making an image disappear in chunks that way, but I was hoping that there was an easier way to do this.

 

Thanks.

Link to comment
Share on other sites

Well here is what i do. 

create(){   this.EnergyBarOriginalHeight = this.EnergyBar.height;}update(){   this.EnergyBar.height = (this.currentEnergy / this.maxEnergy) * this.EnergyBarOriginalHeight;}

this will update the energybar every game tick. if hero is some how regenerates energy it will also fill towards original height.

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...