Vertical Gauges for GUI

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Vertical Gauges for GUI

Post by Akaya »

I'm having trouble adding a vertical gauge to my GUI. I want it to track my experience percentage. I was hoping someone might have a vertical gauge script I could look at. Here's a piece of my GUI:Image

The green bar with the percentage is where I need the vertical gauge.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vertical Gauges for GUI

Post by Oneymus »

For vertical gauges, you have to offset the Y of the foreground label when you offset its height.
Code: [show] | [select all] lua
local vert = {
  x = 0,
  y = 0,
  width = 10,
  height = 100,
  r = 50,
  g = 255,
  b = 50,
}

createLabel( "vert_back", vert.x, vert.y, vert.width, vert.height, 1 )
setBackgroundColor( "vert_back", vert.r * 0.5, vert.g * 0.5, vert.b * 0.5, 255 )

createLabel( "vert_front", vert.x, vert.y, vert.width, vert.height, 1 )
setBackgroundColor( "vert_front", vert.r, vert.g, vert.b, 255 )

function updateVert (current_stat, max_stat)
  local scalar = current_stat / max_stat
  if scalar > 1 then
    scalar = 1
  end

  resizeWindow( "vert_front", vert.width, vert.height * scalar )
  moveWindow( "vert_front", vert.x, vert.y + (vert.height - (vert.height * scalar)) )
end
Hope that helps!

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Vertical Gauges for GUI

Post by Akaya »

Alright! I got it working! Thanks so much. That script worked wonders.

Here's a screenshot of it in action. It's being used to track my experience.

Image

charicner
Posts: 8
Joined: Tue Jun 18, 2013 4:33 pm

Re: Vertical Gauges for GUI

Post by charicner »

Ooooo, this is what I am trying to do with mine, but set up for bards. Is this useig geyser or vysor

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: Vertical Gauges for GUI

Post by Akaya »

Neither actually. Though both Vyzor and Geyser would make the process much easier.

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: Vertical Gauges for GUI

Post by Jor'Mox »

Vertical gauges are being integrated into normal gauge function with the next release, making it very simple regardless of how you decide to do it.

Post Reply