The Geyser Layout Manager

Geyser is an object oriented framework for creating, updating and organizing GUI elements within Mudlet.
User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: The Geyser Layout Manager

Post by Vadi »

Mind adding some examples for this?

Beliar
Posts: 19
Joined: Fri Apr 22, 2011 12:51 pm

Re: The Geyser Layout Manager

Post by Beliar »

Well, lets see.

You have a image "ui_top.png" with a size of 129x12. You wanted that tiled horizontally.

Like this: ------------------------------------

The following code creates an window with the image tiled horizontally over that:
Code: [show] | [select all] lua
Geyser.TiledImage:new({
      name="ui_top",
      x="0px", y="0px",
      width="100%", height=12
      tile_image="ui_top.png", -- This is the path to the image
      tile_width=129,  --Width of a single tile
      tile_height=12, --Height of a single tile
      }
Next, you want an image tiled vertically:

Like this:
|
|
|
|
|
Code: [show] | [select all] lua
Geyser.TiledImage:new({
      name="ui_left",
      x="0px", y="0px",
      width=12, height="100%"
      tile_image="ui_left.png", -- This is the path to the image
      tile_width=12,  --Width of a single tile
      tile_height=129, --Height of a single tile
      tile_alignment=Geyser.TileAlignment.vertical --Tells the class to tile vertically. It defaults to horizontal.
      }
Now you want to have another image(s) at the start/end of the window.

Like this : (-------------------------------)
Code: [show] | [select all] lua
Geyser.TiledImage:new({
      name="ui_bottom",
      x="0px", y="0px",
      width="100%", height=12
      tile_image="ui_bottom.png", -- This is the path to the image
      tile_width=129,  --Width of a single tile
      tile_height=12, --Height of a single tile
      start_tile_image = "ui_bottom_left.png", -- Path to the image of the start tile
      start_tile_wdith = 50, -- Width of the start tile
      start_tile_height = 12, -- Height of the start tile
      end_tile_image = "ui_bottom_right.png",  -- Path to the image of the end tile
      start_tile_wdith = 30, -- Width of the end tile
      start_tile_height = 12, -- Height of the end tile
      }
Hope that helps.

Beliar
Posts: 19
Joined: Fri Apr 22, 2011 12:51 pm

Re: The Geyser Layout Manager

Post by Beliar »

I found an easier way if you just need a single image tiled on a label:
Code: [show] | [select all] lua
setStyleSheet("background-image: url(" .. imageFileName .. ");")

Beliar
Posts: 19
Joined: Fri Apr 22, 2011 12:51 pm

Re: The Geyser Layout Manager

Post by Beliar »

I have made some additions to Geyser:

- Removed TIledImage
- Added setTiledBackgroundImage method to Geyser.Label, which does (mostly) the same as TiledImage, only its faster
- Added classes to align windows horizontally or vertically and automatically stretching them to fit.
- Added simple Manual/Tutorial for Geyser.
- Geyser uses registerAnonymousEventHandler to automatically register itself to sysWindowResizeEvent

[edit]
Note: These need Mudlet 2.0rc3
[/edit]

I hope these will be added to mudlet, but if you want to test them first you can download them here:

https://github.com/Beliaar/mudlet-lua/downloads

Download on the files listed under "Download Packages"

Just replace the mudlet-lua directory in your mudlet directory with the directory in the download, maybe backing up your directory before.

The manual is in the geyser directory as a html file.

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

Re: The Geyser Layout Manager

Post by Vadi »

I don't think keeping the Geyser manual separate is a good idea, or one that users will like. Can you please see about moving it to http://wiki.mudlet.org/w/Category:Mudlet_Manual instead?

Beliar
Posts: 19
Joined: Fri Apr 22, 2011 12:51 pm

Re: The Geyser Layout Manager

Post by Beliar »

I never intended it to be separate - it uses the same CSS as the mudlet manual after all, and I didn't know that there was a page for that in the wiki. I will see what I can do to add that there.

Edit:
http://wiki.mudlet.org/w/Manual:Geyser

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

Re: The Geyser Layout Manager

Post by Vadi »

cool, thanks!

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

Re: The Geyser Layout Manager

Post by Akaya »

Can Geyser.Gauge fill from right to left instead of left to right?

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

Re: The Geyser Layout Manager

Post by Jor'Mox »

Yes, use the "goofy" style where you would normally use "vertical" or what have you. The newer gauges that I designed do the same, and I believe they are being incorporated with the next release as the default gauges, just FYI.

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

Re: The Geyser Layout Manager

Post by Akaya »

ah. Didn't even know orientation was an argument. Thanks!

Post Reply