# Getting a bar to scale 0-100%

**URL:** <https://forum.kirupa.com/t/getting-a-bar-to-scale-0-100/301663>\
**Category:** programming\
**Created:** [December 13, 2009, 2:58pm UTC](https://forum.kirupa.com/t/getting-a-bar-to-scale-0-100/301663 "2009-12-13T14:58:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [December 13, 2009, 2:58pm UTC](https://forum.kirupa.com/t/getting-a-bar-to-scale-0-100/301663/1 "2009-12-13T14:58:51Z")

</div>

Just a quick one today.

I’ve currently set up my Health bar to use xscale and the health is currently 100 and it all works fine. But I want the hero to be able to upgrade their health to higher values, and when I do this, the bar scales to 120px, 150px, etc, and outside of the Health bars border.

Is there any way to make the bar scale 0-100% relative to the Healths maximum value so values like 200 dont shoot out of the Healthbars border?

Thanks in advance.
