Author Topic: Custom Health Bars  (Read 2165 times)

kodagames

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Custom Health Bars
« on: July 20, 2014, 11:03:09 PM »
Hello,

Is it possible to create a custom health bar like in this video (frame 15:02 on the timeline)
https://www.youtube.com/watch?v=dpXJrgRJRQI#t=505
you'll see the Red icon on the left hand side what Id like to do is create a hud that fades down like in the video using Ngui.

As you can see I can easily do it with Unity by messing with a materials _CutOff (like in the video above) but then I lose out on saving on draw calls etc..

P.S.
ArenMook, Tasharen, NGUI.. Absolutely Amazing!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Custom Health Bars
« Reply #1 on: July 21, 2014, 04:55:01 PM »
Yeah, just use a Filled type sprite.

kodagames

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 8
    • View Profile
Re: Custom Health Bars
« Reply #2 on: July 21, 2014, 10:47:09 PM »
Wow Thats AWESOME!!! especially the Filled Dir (Radial360). I had no idea this was here :P

I used a button to decrease the the sprite (in case it helps anyone).

  1. #pragma strict
  2.  
  3. var aScript : UISprite;//to access a UISprite attach the script here.
  4.  
  5. function GetFillAmount(){
  6.         aScript.fillAmount -= 0.01;
  7. }