iGauges, for simple image based gauges without too much hassle

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

iGauges, for simple image based gauges without too much hassle

Post by demonnic »

First off, big thanks to Jamie W. (Delra) for putting the initial concept together. I just took what they gave me and made it follow the Geyser patterns and used some lesser known Geyser utilities to make it a bit more flexible.

So I made a thing. You can download it from HERE if you want to try it out. I've checked it into github as a muddler project, if you have any feature requests or find any bugs please file them HERE



I'll show you all the different types it has below. Right now it only does horizontal and left to right fill, but I intend to extend that in the future.

The 'default' gauge type is 'bar', but I include it here to show where you would change it on init:
Code: [show] | [select all] lua
testGauge = demonnic.iGauge:new({name = "testGauge", x=700, y=200, width = 100, height = 30, fillcolor = "purple", bartype = 'bar'})
Which gives you:
example1.png.jpg
example1.png.jpg (1.81 KiB) Viewed 5327 times
After that, you can do:
Code: [show] | [select all] lua
testGauge:update(35)
example2.png
example2.png (599 Bytes) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:setType("chevron")
example3.png
example3.png (966 Bytes) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:update(57, "<80,0,0>", "<60,60,60>")
example4.png
example4.png (1.05 KiB) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:setType("curve")
example5.png
example5.png (1.37 KiB) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:setType("heart")
example6.png
example6.png (1.23 KiB) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:setType("slant")
example7.png
example7.png (1.07 KiB) Viewed 5327 times
Code: [show] | [select all] lua
testGauge:setType("alpha")
example8.png
example8.png (936 Bytes) Viewed 5327 times

Cail
Posts: 7
Joined: Wed Sep 24, 2014 10:38 pm

Re: iGauges, for simple image based gauges without too much hassle

Post by Cail »

I'm starting to try using this and had a minor question. Is there any way for me to set the overall background color? I have the gauge in something with a non-black background and would really like to make the background transparent or match with that background to give a bit cleaner look.

Essentially I have the fill and empty colors what I want but want to change the bounding container background color to match.

I'm not afraid to dig into the package and edit I just didn't want to spend a bunch of time figuring it out if someone already has a good idea.

User avatar
demonnic
Posts: 650
Joined: Sat Dec 05, 2009 3:19 pm

Re: iGauges, for simple image based gauges without too much hassle

Post by demonnic »

the iGauge is still a label, just using css gradients and a transparent image to create the separation. So setBackgroundColor can still be used against it

Post Reply