Image filling with higher values?

I found a quick tut on creating floating health bars using images and filling one image to show it decreases, etc. My only problem is that you can fill it with a value between 0 and 1, which is fine if your health is going to be 1, 10, 100, 1000, etc, but mine will be 100, 250, etc and I have powerups that will add onto the health. How can I go about using values like that? Hopefully this makes sense.

0->1 is used a lot because it a simple scalar for any value.

If your health goes from 0 → 250, well to get the value it’s health/250, and to get the health it’s value*250.

Even if it goes from 50 to 175, you can still get it. The value is (health - 50)/125, and the health is value*125 + 50.

That is unless I’m misunderstanding what you mean by:

But most fill bars are setup the way I described.

1 Like

I wasn’t even thinking. This was a simple problem. Been a long day.

1 Like