Vyzor, UI Manager for Mudlet

Share your scripts and packages with other Mudlet users.
User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by kevutian »

Not sure if this has been mentioned, but we need a "like" button. :)

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Vadi »

tgu is mesmerising.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Vadi »

I played around with Vyzor for a bit. How would one go about using a single background image for the borders in the best manner?

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

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

I think they would work well for things like KaViR's enemy pictures, or maybe even the compass in your fancy GUI's (though lining up child Frames would require some math). I might use them for Gauges.

I'll have an example GUI completed soon, which I will release (with graphics) so people can get a better idea of what's possible for Vyzor. The only thing I need to finish on it are the Gauges; I prefer images to gradients (for aesthetic reasons), but the gradients work just fine.

If you wanted to create a Border Image Component, you would:
Code: [show] | [select all] lua
local img_border = Vyzor.Border( nil, nil, some_image )
-- Although, you will either need to add a width to this border, or add some padding,
-- otherwise anything else will overlap.

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

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Vadi wrote:tgu is mesmerising.
Yes. Yes, it is.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Vadi »

Ah, so cutting is still necessary for all the main frames?

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

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Cutting? In what way? The Content dimensions don't account for images, so without any other information to go on the Content box will be as big as the Frame.

Do you mean cutting the image itself? Qt takes an image and divides it into 9 pieces when making Border Images, and stretches and contracts based on those portions. No cutting should be necessary.

Unless I'm misunderstanding.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Vadi »

What is the main frame then that I can set the background on?

I'm playing with porting this Geyser-made UI:

Image

Full code + images for it here: http://ge.tt/8wArtOC

It had to be cut up into pieces for top, left, right in order to show. With Vyzor, can I just use Forest.jpg as the background?

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

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Oh! For the main background, you will have to cut it up. That's more of a Mudlet thing; a Label would cover the main console. The HUD itself isn't drawn for that reason. If I could manipulate images, I might try to work around that, but that's not possible right now.

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

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Updated Vyzor. A couple of bug fixes.

Added a sample GUI. There appears to be some issues with grabbing images from profiles. I wasn't able to figure this out. Neither getMudletHomeDir() nor a hardcoded path worked for me. However, if I symlinked the images folder to C:/, it worked perfectly.
Summary:
Code: [show] | [select all] lua
-- Didn't work.
SampleGui.Path = getMudletHomeDir() .. [[/SampleGui/images/]]

-- Didn't work.
SampleGui.Path = [[C:\Users\Administrator\.config\mudlet\profiles\Vyzor/SampleGui/images/]]

-- Does work. This folder is symlinked from hardcoded location above.
SampleGui.Path = [[C:/images/]]
That said, if you can get it to work, it should look like this. As you can see by comparing the two images, everything is correctly proportioned even after arbitrarily resizing Mudlet. Gauges included. This demonstrates one of the primary strengths of Vyzor: no-hassle distribution.

All images are courtesy Google Images, edited by me. I make no claims to them, or the GUI in general. In fact, it should be usable with some minor tweaking (gauge variable addresses, at least). Echoing to the consoles works. Feel free to take this and mess with it to your heart's content.

GUI's do not have to be organized as I organized the sample, mind. As long as everything is ready by the time you call Vyzor.HUD:Draw(), there shouldn't be any problems.

As always, feedback.

Post Reply