Vertical Gauge

Post Reply
eraldo
Posts: 43
Joined: Sun Jul 12, 2009 1:25 am

Vertical Gauge

Post by eraldo »

how do I make vertical gauges?
I have made one ... but my problem is...
that the bar fills from top to bottom
I want it to go from bottom to top
is there a way to make the height of a label go in the other direction?
> from position x,y going upwards

At the moment I will use the following workaround:
start with 0 height for the Label with the backgroundcolor and make it grow,
istead of growing the foreground-label.

I would be glad if there where a different way to solve this.

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: Vertical Gauge

Post by Caled »

Of course. You get the gauge to appear to be growing/shrinking, by having two images above one another, and resizing the X dimension of the upper image. For example, the X value might be resized in proportion to your current health, each time it changes.

A vertical gauge is as simple as resizing the Y instead. Check out Heiko's demonstration script, and try changing it.

eraldo
Posts: 43
Joined: Sun Jul 12, 2009 1:25 am

Re: Vertical Gauge

Post by eraldo »

I have the feeling you misunderstood my post / the question.

I did try his demo scripts.
I do have working gauges...
alot of them to be exact...
and with x and y you mean height and width I suppose.

but as Height increases downwards... that only gives a vertical gauge which fills from top to bottom...
what I am looking for is a gauge that fills from bottom to top!

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Vertical Gauge

Post by Heiko »

eraldo wrote:how do I make vertical gauges?
I have made one ... but my problem is...
that the bar fills from top to bottom
I want it to go from bottom to top
is there a way to make the height of a label go in the other direction?
> from position x,y going upwards

At the moment I will use the following workaround:
start with 0 height for the Label with the backgroundcolor and make it grow,
istead of growing the foreground-label.

I would be glad if there where a different way to solve this.
Gauges are just one way of using Mudlet's generic clickable labels. They can also be used as layered image maps, plain images, icons, clickable buttons, text or variable displays etc.. They are so powerful because they are kept so general.

If you develop special functionality it should be either included in the distributed Mudlet Lua include file LuaGlobal.lua and included in the manual if it's of general interest or posted as a package if it's of lesser general interest. In the case of vertical and horizontal gauges both would be appropriate. You could write functions such as gaugeHorizontalCreate(x,y, length, height), gaugeVerticalCreate( ... ) and gaugeSetValue( ... ). Furthermore, you could add functions to make fancy gauges based on png images. Another area of general interest would be to write functions for clickable on screen buttons, pull down menus etc. Those things would be of general interest and would expand the distributed Lua API.

Post Reply