Well, whenever you want to make a HP bar or anything else, if you want to modify its position, size or even the thickness of that black line, you must rewrite the whole script...So I made this function...The only thing you must know is that the "value" must always be 100.0 when it's max. So if you have, for exemple, a car's HP that is 750.0 (at 250.0 it ignites), you must divide it by 7.5 to become 100.0.
To call the function:
The function:
Photo
To call the function:
Code:
0AB1: call_scm_func @drawBar 6 coords_X 3@ coords_Y 4@ value 5@ size X 40.0 Y 4.0 thickness 2.0 // The value must be 100.0 (eg. max_HP = 750.0 ==> max_HP /= 7.5)
The function:
Code:
:drawBar
13@ = 100.0
0073: 13@ /= 3@ // (float)
0073: 2@ /= 13@ // (float)
0087: 11@ = 3@ // (float)
0087: 12@ = 4@ // (float)
005B: 11@ += 5@ // (float)
005B: 12@ += 5@ // (float)
038E: draw_box_position 0@ 1@ size 11@ 12@ RGBA 0 0 0 255
038E: draw_box_position 0@ 1@ size 3@ 4@ RGBA 100 0 0 255
0087: 10@ = 2@ // (float)
0017: 10@ /= 2.0
0017: 3@ /= 2.0
005B: 0@ += 10@ // (float)
0063: 0@ -= 3@ // (float)
038E: draw_box_position 0@ 1@ size 2@ 4@ RGBA 255 0 0 255
0AB2: ret 0
Photo
Last edited: