Greetings! Quick question for everyone...
I'm starting to dabble with gauges with the script I'm writing. is there a way to use the draw gauge function but make the gauge fill from the right to left, instead of the default left to right?
This will require modification of the draw_gauge method, but I would suggest copypaste and renaming to make it a new method.
here is the origonal:
def draw_gauge(x, y, width, rate, color1, color2)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x, gauge_y, width, 6, gauge_back_color)
contents.gradient_fill_rect(x, gauge_y, fill_w, 6, color1, color2)
end
I was trying to figure out how to modify it to make it do what you want but its not as easy as I thought -- at least not for me. Hmm...
Edit: Untested, this probably wont work, just an idea really:
def draw_reverse_gauge(x, y, width, rate, color1, color2)
fill_w = (width * rate).to_i
gauge_y = y + line_height - 8
contents.fill_rect(x+width, gauge_y, width, 6, gauge_back_color)
contents.gradient_fill_rect(x+width, gauge_y, fill_w, 6, color1, color2)
end
If that doesn't work, apologies... Come to think of it it will probably just start filling the gauge at the end of the gauge and beyond.
Actually kind of tricky to get it to fill back. Might be better off writing a new method.
I'm sure someone has a simple solution that will make me feel dumb lol 
Your question (in my opinion) deserves its own thread though.
Edited by Matt_Sully(Gump), 09 May 2013 - 12:19 PM.