Hi,I'm currently trying to make a health bar for my HUD , in an RPG game, unfortunately, I can't go If(hp == 90) icon_state = "90hp" , because at a high level, 90 would be VERY low.
So, does anyone know how to do percentage?
You wouldn't need to put the ,1 at the end of the round().
Round() defaults to 1. ;)
Actually, round(n) is equivalent to a floor() function, whereas round(n,1) will round to the nearest whole number. For simple displays like this, it probably doesn't matter, but it's important to keep in mind when doing heavier calculations.
Hi,I'm currently trying to make a health bar for my HUD , in an RPG game, unfortunately, I can't go If(hp == 90) icon_state = "90hp" , because at a high level, 90 would be VERY low.
So, does anyone know how to do percentage?
> icon_state="[round(health/maxhealth*100,1)]%" >
It's giving me crap about constant expression, which I don't even know what that is, and it recognizes "HP/maxHP" as a full variable ;( Anyone know why?
Round() defaults to 1. ;)