In the my healthbar I have maxValue=632 and minValue=507.
It is X-coordinates. I need to transform it in to percents where:
- 507 = 0%;
- 632 = 100%;
And for that I need a formula to calculate it. Something like this:
healthText.text = " Health: " + (int)(currentHunger * 100 / 632);