Vyzor, UI Manager for Mudlet
Re: Vyzor, UI Manager for Mudlet
How do you set the font color of a gauge? I'd like the text on them to be white, as my gauges have a black background.
Re: Vyzor, UI Manager for Mudlet
Thank you. How would I go about replacing 'my text' with the current and max hp of my character? I'd like to grab this from gmcp.Char.Vitals.
Re: Vyzor, UI Manager for Mudlet
I think that's the variable for maximum health. Might be maxhp though.
Re: Vyzor, UI Manager for Mudlet
Sorry to keep pestering with questions. Here's a code sample first to show what I have. I have consulted the documentation and made some educated guessed, but no luck yet fully getting what I want.
Two problems here: First off, the text colours white but it does not center. Is text-align not supported? If so, how could I get it to center the text? Secondly, when recieving gmcp data, the text suddenly changes back to black, does become centered, and displays hp / maxhp. Nice, but not quite what I wanted. What I want to achieve is centered white text that gets its data from gmcp. I'm almost certain this means the Vyzor.Gauge function needs some editing, but the text values there seem required.
Re: Vyzor, UI Manager for Mudlet
use tags. <center> </center>
Last edited by Akaya on Tue Jan 28, 2014 5:38 pm, edited 1 time in total.
Re: Vyzor, UI Manager for Mudlet
Ah yes, forgot those exist. What about the overwriting? I'm guessing it is due to the line that defines the gauge, but the text parameters seem mandatory.
Re: Vyzor, UI Manager for Mudlet
Gauges have a TextFormat property you can use to change the text. By default, the format is "<center>%s / %s</center>". The two variables (%s) in there correspond to the current and maximum values set when you make a new gauge.
There is also the AutoEcho property, which defaults to true.
This means, every time a gauge updates, it will automatically echo "<center>10 / 100</center>", for example.
One solution to your problem is to set AutoEcho to false, and manually echo every time you call gauge:Update(). Or, and this is the preferred method, you can just set TextFormat to whatever you want, and Vyzor will automatically echo that every Update.
For instance:
There is also the AutoEcho property, which defaults to true.
This means, every time a gauge updates, it will automatically echo "<center>10 / 100</center>", for example.
One solution to your problem is to set AutoEcho to false, and manually echo every time you call gauge:Update(). Or, and this is the preferred method, you can just set TextFormat to whatever you want, and Vyzor will automatically echo that every Update.
For instance:
If you haven't turned AutoEcho off, and you're manually echoing, then you're echoing twice. Which might explain any oddities, like the overwriting.
Re: Vyzor, UI Manager for Mudlet
Awesome, that got it working the way I want. Thank you both for your help Got to say, you can do some pretty nifty stuff with Vyzor, certainly going to tinker with it some more.
Re: Vyzor, UI Manager for Mudlet
No problem. Happy to help!