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

 Share

  • Recently Browsing   0 members

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