- Home /
Creating 2d Health Bars
SO i wanted to create a health bar for my player character and enemy.
I found some answers... but wasnt happy with them. Most included 3D view.
Is there a possiblity to draw an rectangle over enemy which is 200 pixels width and with each attack the rectangle tranforms to 75 %, 50 %, 25 % of the length?
Is there any other method to draw rectangle than to use GUI function?
Answer by Jeff-Kesselman · Nov 11, 2014 at 10:32 PM
Sure, there are lots of ways.
I did this for a fighting game using two GUITextures. The first is the box for the rectangle. The second is the rectangle itself.
To make it shrink towards the right side, i just changed the second GUtexture's size in X. To make it scale to the right, i changed its size and moved it over.
Answer by Marcel81 · Nov 11, 2014 at 10:34 PM
You could use the line renderer to draw a line with a specific thickness
Your answer
Follow this Question
Related Questions
Health Bar Issues 1 Answer
progress bar 1 Answer
Stop Timebar decrease by pressing key button 1 Answer
Android re-hide status bar (Lollipop) 2 Answers
How to change Android navigation/status bar color? 0 Answers