Hey guys,
I've been spending loads of time figuring out miniwindows, and I've spent some time (not as much as I'd like) trying to learn the code (thanks nick and fiendish for pushing me)
I'm having problems figuring out where to place my string format.
I've currently worked out how to do a number overlay on my gauges, but I've not worked out how to format that number overlay..
I'm looking to put hp/max_hp, and also a percentage.
So far, I've been able to overlay just the current number of hp itself, but I don't quite understand where to place my string.format code.
This is the code where the numbers are overlaid into the gauge.
WindowText (win, font_id, current,
gauge_left + 3, vertical + 1, 0, 0, ColourNameToRGB ("black"))
WindowText (win, font_id, current,
gauge_left + 2, vertical + 1, 0, 0, ColourNameToRGB ("black"))
WindowText (win, font_id, current,
gauge_left + 1, vertical, 0, 0, ColourNameToRGB ("white"))
I've attempted to add
string.format ("%s\t%i / %i (%i%%)"
into my code, but I'm not quite sure where I should place it..
My numbers run off of "current", and "max".
Also, if you could please direct me a tiny bit (link?)
on how the order of the functions work
I.E. ,
I'm imagining it calls them in order, but I'm not sure how I can add to this to make it all work out. Would I need to add string.format into the code before current to make it call current with the string.format? I've tried this, and it didn't quite work. I just need a tiny bit of help please.
I'm sure I could teach myself the rest, and it would become much easier for me not to bother anyone with asking for help again.
I'd also love to be able to post the code of the updated gauges for public usage, since they'll have been upgraded a bit over the standard Health Gauge by Nick Gammon.
Thank you again.
Vivi |