dim3 Forum

Full Version: Using a graphic as a health bar
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there a way I could modify the scripts to make it so the health bar is a graphic, and then mask it when the player recieves damage. I would also like to use a image instead of tinting the screen when damage is recieved, so I can put blood, scratchs, ect.
adobemedia Wrote:Is there a way I could modify the scripts to make it so the health bar is a graphic, and then mask it when the player recieves damage. I would also like to use a image instead of tinting the screen when damage is recieved, so I can put blood, scratchs, ect.

Sure, right now the health bar is just hooked to a "bar" and updated when the health changes. You'd probably want to setup a series of bitmaps in the interface xml file, and then turn them on/off depending on the amount of health.

[>] Brian
Or, you can put in one bigger bitmap, and have 100 frames of animation in it, 1 for each health point, and use the texture fill value api to switch animation frames. You can do some pretty cool effects with that.
Dr. Infested Wrote:Or, you can put in one bigger bitmap, and have 100 frames of animation in it, 1 for each health point, and use the texture fill value api to switch animation frames. You can do some pretty cool effects with that.

Sad

Insane way of doing it.
So I cannot just mask it, or tint it? That is a hard way of doing it.
Bar: I have thought of 2 ways you could do it, one is to squish the bitmap smaller when health is less, OR have a background behind the bar. What I mean is, if the health is empty it is blue (for example), when there is health it uses your bitmap. What you do is scale the blue bitmap OVER your bar bitmap to make it look like the bar is getting smaller. Get it?

Screen flash: Flash an image, I forget the API and stuff but it should be in the docs....
That first way is exactly what I was thinking. I'll try it out.
mafoo Wrote:
Dr. Infested Wrote:Or, you can put in one bigger bitmap, and have 100 frames of animation in it, 1 for each health point, and use the texture fill value api to switch animation frames. You can do some pretty cool effects with that.

Sad

Insane way of doing it.

Okay, maybe 100 frames is a bad idea, but if you had say 25 or less for something, it would work fine.
Reference URL's