-
Advanced health bar help please!!
Hey guys what's up
I am currently working on a project where the length of the Hero's Health Bar increases as it levels up
How could this be achieved?
Also what I'm really looking for is that the Health Bar circles around the Hero's portrait, a good example would be Sora from Kingdom Hearts
Just two examples!!
http://movies-music-games.com/wp-con...hearts_2_1.JPG
http://jackcentral.com/wordpress_2.8...09/10/KH02.jpg
mad respects to anyone willing to help me out!!
any advice or tips would be greatly appreciated, thank you!!!!
-
Use code like this to draw arcs of the appropriate size, with a fill. I wouldn't use that class directly, but it does show you how to draw an arc of arbitrary size and position, which you can use in conjunction with beginFill to make your circularly filled bars.
-
Hmm thanks I could try to incorporate that method somehow...I'm just really not sure how
:P
Could anyone suggest a different method, or explain the method above?
Thanks!!!!!!!!
-
The way I was thinking was that you would take that code and turn it into a drawArc method. You will then take your Sprite's Graphics object, and draw one large radius arc, a line to the inner arc, and the inner arc back, then a line connecting them.
Do the same thing again, but with a shorter angular length and begin fill active to draw the filled portion of the health bar.
Alternatively, you could pre-draw your empty bar, then just draw the line where the boundary is, then draw the whole thing into a Bitmap. Then use floodfill to fill the health area. You will display the final Bitmap, but keep the original vector drawing of the empty healthbar around to draw from again when the health changes.
-
alrite man thanks a lot i'll definitly take your responses into consideration
youve been very helpful
although i am still quite unsure on how to optimize this project, is there anyone else willing to help me out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|