Geyser UI Template

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

Re: Geyser UI Template

Post by Akaya »

The template resizes just fine after testing it with multiple lines on the command prompt.

It seems the image you're placing within the icon is having resizing issues. You'll want to provide that part of your script for the best help.

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

Re: Geyser UI Template

Post by icesteruk »

my other 8 buttons are done the same way just the word 'precache' is replaced!
Code: [show] | [select all] lua
GUI.PrecacheIcon = Geyser.Label:new({
  name = "GUI.PrecacheIcon",
  width = "82%",
  height = "78%",
},GUI.Icon9)
GUI.PrecacheIconCSS	 = CSSMan.new([[
  margin: 2px;
  border-image: url("]]..getMudletHomeDir():gsub("\\","/")..[[/images/precacheon.png");
]])
GUI.PrecacheIcon:setStyleSheet(GUI.PrecacheIconCSS:getCSS())
 

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

Re: Geyser UI Template

Post by Akaya »

It is because you're not setting your x,y position. So the images are placed one atop the other, the last of which is Icon9 so its shown on the top of the stack.

I don't set position or size with the GUI.Icon# because they're added to a Geyser HBox (GUI.Header) which handles the position and size for you. If you're adding your label to a label, size AND position must be set.

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

Re: Geyser UI Template

Post by icesteruk »

so, I should delete the for i = 9, stuff which makes the icons at moment and make real label icons?


Thanks :)

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

Re: Geyser UI Template

Post by Akaya »

No. You just need to specify x and y like so:
Code: [show] | [select all] lua
GUI.PrecacheIcon = Geyser.Label:new({
  name = "GUI.PrecacheIcon",
  x = 0, y = 0,
  width = "82%",
  height = "78%",
},GUI.Icon9)
 
You could even put these in a for loop if you have a local table with all the icon names...
Code: [show] | [select all] lua
--Haven't tested. Written on the forum.
local names = {"Bashing","Combat","Mass","Rebound","Arena","Quests","Leyline","Room","Precache"}
for k,v in pairs(names) do
  GUI[v.."Icon"] = Geyser.Label:new({
    name = "GUI."..v.."Icon",
    x = 0, y = 0,
    width = "82%",
    height = "78%",
  },GUI["Icon"..k])
end

fetaera
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm

Re: Geyser UI Template

Post by fetaera »

Would that not create labels over the top of others? Unless there's something I am not seeing here, a Geyser vbox/hbox would be the way forward here.

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

Re: Geyser UI Template

Post by icesteruk »

Akaya wrote:No. You just need to specify x and y like so:
Code: [show] | [select all] lua
GUI.PrecacheIcon = Geyser.Label:new({
  name = "GUI.PrecacheIcon",
  x = 0, y = 0,
  width = "82%",
  height = "78%",
},GUI.Icon9)
 
I did x = 0, y = 0, on them all and rebooted etc and still having the issue..
Akaya wrote: You could even put these in a for loop if you have a local table with all the icon names...
Code: [show] | [select all] lua
--Haven't tested. Written on the forum.
local names = {"Bashing","Combat","Mass","Rebound","Arena","Quests","Leyline","Room","Precache"}
for k,v in pairs(names) do
  GUI[v.."Icon"] = Geyser.Label:new({
    name = "GUI."..v.."Icon",
    x = 0, y = 0,
    width = "82%",
    height = "78%",
  },GUI["Icon"..k])
end

I'll test the loop later once I figure it out, :)

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

Re: Geyser UI Template

Post by Akaya »

Would that not create labels over the top of others? Unless there's something I am not seeing here, a Geyser vbox/hbox would be the way forward here.
Perhaps they want to keep the thin white border from the template around their image? Another label must be added for an image to have a border.

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

Re: Geyser UI Template

Post by icesteruk »

Sorry to be a pain but after messing with the above Stuff I'm getting this Error on my box4 and I've reverted back to how it was, but still getting this error and unsure as to why... anyone know why?

[ERROR:] object:<Update Stat Window> function:<Alias11>
<./mudlet-lua/lua/StringUtils.lua:165: attempt to index local 'self' (a nil value)>

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

Re: Geyser UI Template

Post by icesteruk »

the above issue was somethign stupid but seems the pictures keep going outside the set width/height/x/y so had to delete them and just stick to text!..

Post Reply