Game Development Community

Problems getting progressbarbitmapcrt to work

by Josh Minger · in Technical Issues · 06/26/2012 (1:39 pm) · 1 replies

Hello im trying to use a progress bar with a bitmap for a health bar, im using the default number health script and im trying to set the curHealth var to the progress bar but it doesnt seem to work. what am i doing wrong?

About the author

I am Josh Minger. I currently live in USA, and do game development for Eclision Entertainment. I am project leader and owner of the company as well. I am 20 and have a son and another on the way.


#1
06/26/2012 (1:59 pm)
What values are you passing into the control using? A progress bar accepts a range from 0-1, thus curHealth (as used by the scripted health tracking) would have to be divided by 100 in order to fall into the range the control is expecting.
NAMEOFCONTROL.setValue(1); // yields a full bar (bar size determined by extent of control
NAMEOFCONTROL.setValue(0.5); // yields half a bar
NAMEOFCONTROL.setValue(0.25); // yields 1/4 of a bar
NAMEOFCONTROL.setValue(0); // no bar, but does render the end pieces if using an array of images for the bar image