With this function you can draw gradient bars, as the title says. You must be careful to the "value", which musn't be higher than 100.0, or it will fail.
Just a little example of how it works:
0AB1: call_scm_func @drawGradientBar 11 position 320.0 224.0 size 56.0 6.0 value 100.0 RR 0.0 0.0 GG 100.0 155.0 BB 155.0 255.0
This will draw a full bar (100.0/100.0) from 320.0 to 376.0 ( size 56.0). The initial green value (for value == 0.0) is 100.0 and the final one (for value == 100.0) is 155.0. Same from blue, just from 155.0 to 255.0.
Image:
Requests:
*03F0: enable_text_draw 1 at the beggining of your script.
Just a little example of how it works:
0AB1: call_scm_func @drawGradientBar 11 position 320.0 224.0 size 56.0 6.0 value 100.0 RR 0.0 0.0 GG 100.0 155.0 BB 155.0 255.0
This will draw a full bar (100.0/100.0) from 320.0 to 376.0 ( size 56.0). The initial green value (for value == 0.0) is 100.0 and the final one (for value == 100.0) is 155.0. Same from blue, just from 155.0 to 255.0.
Code:
:drawGradientBar
//0AB1: call_scm_func @drawGradientBar 11 position 320.0 224.0 size 56.0 6.0 value 100.0 RR 0.0 0.0 GG 100.0 155.0 BB 155.0 255.0
0087: 12@ = 2@
0017: 12@ /= 100.0
0087: 13@ = 6@
0063: 13@ -= 5@
0073: 13@ /= 4@
0092: 5@ = float 5@ to_integer
0092: 13@ = float 13@ to_integer
0087: 14@ = 8@
0063: 14@ -= 7@
0073: 14@ /= 4@
0092: 7@ = float 7@ to_integer
0092: 14@ = float 14@ to_integer
0087: 15@ = 10@
0063: 15@ -= 9@
0073: 15@ /= 4@
0092: 9@ = float 9@ to_integer
0092: 15@ = float 15@ to_integer
for 11@ = 0.0 to 4@ step 1.0
038E: draw_box_position 0@ 1@ size 12@ 3@ RGBA 5@ 7@ 9@ 255
005B: 0@ += 12@
005A: 5@ += 13@
005A: 7@ += 14@
005A: 9@ += 15@
end
0AB2: ret 0
Image:

Requests:
*03F0: enable_text_draw 1 at the beggining of your script.