Geyser UI Template

Share your scripts and packages with other Mudlet users.
icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

ah nice! I'll look into that later today!

Template

is what I have so far!

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

Re: Geyser UI Template

Post by Akaya »

That's lookin' pretty sweet!

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

with this code
Code: [show] | [select all] lua
mylabel:setStyleSheet([[
  border-image: url("]]..getMudletHomeDir():gsub("\\","/")..[[/myimage.png");
]])
How do I put it in the picture below but in the 'border' so the border is still shown?
Attachments
testit.png
testit.png (14.23 KiB) Viewed 8137 times

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

Re: Geyser UI Template

Post by Akaya »

You'll want to create a label inside the label with the thin white border. Give this label a margin in the stylesheet like so:
Code: [show] | [select all] lua
mylabel:setStyleSheet([[
  margin: 2px;
]])
This is a work around I've found handy for you are not able to apply 2 borders to a single label.

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

so it'll be something like this
Code: [show] | [select all] lua
GUI.BashingIcon = Geyser.Label:new({
    name = "GUI.BashingIcon",
  },GUI.Header)
  GUI.BashingIcon:setStyleSheet(GUI.IconCSS:getCSS())
-- GUI.BashingIcon:cecho("<red><center>GUI Bashing")

GUI.BashingIcon:setStyleSheet([[
 margin: 2px;
  border-image: url("]]..getMudletHomeDir():gsub("\\","/")..[[/images/alertness.png");
]])
?

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

Re: Geyser UI Template

Post by Akaya »

You're applying the GUI.IconCSS stylesheet to GUI.BashingIcon and then setting the stylesheet yet again.
Instead, you can create a new CSSMan.new() and set that.
It would look something like this:
Code: [show] | [select all] lua
--Create the label for the image within the icon
--Notice that I add it to GUI.Icon1 and not GUI.Header
GUI.BashingIcon = Geyser.Label:new({
  name = "GUI.BashingIcon",
},GUI.Icon1)
--Here's where you create a new CSSMan.new specifically for GUI.BashingIcon
GUI.BashingIconCSS = CSSMan.new([[
  margin: 2px;
  border-image: url("]]..getMudletHomeDir():gsub("\\","/")..[[/images/alertness.png");
]])
--Here is where you set the stylesheet.
--Notice that it is GUI.BashingIconCSS and not GUI.IconCSS
GUI.BashingIcon:setStyleSheet(GUI.BashingIconCSS:getCSS())
-- GUI.BashingIcon:cecho("<red><center>GUI Bashing")
 
You'll need to do this for each icon. It's a long way about it, but unless you study up on how the CSSMan script works, this fits the bill.

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

Hmm What are you using for icon1?

edit: OOOO I see :P.. I add to add in width = 80% and height = 80% but seems to work,
Attachments
icon1.png
icon1.png (3.52 KiB) Viewed 8122 times
Last edited by icesteruk on Thu Sep 26, 2013 4:22 am, edited 1 time in total.

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

Re: Geyser UI Template

Post by Akaya »

GUI.Icon1:flash() will show you. flash() is a nifty Geyser function.

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

So, that worked :)

Heres the finished product minus a few things (the top buttons being clickable)
Attachments
system1.png

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

Re: Geyser UI Template

Post by Akaya »

Awesome!

Post Reply