Page 5 of 13

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 6:35 pm
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.

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 6:40 pm
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())
 

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 7:05 pm
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.

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 7:37 pm
by icesteruk
so, I should delete the for i = 9, stuff which makes the icons at moment and make real label icons?


Thanks :)

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 8:25 pm
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

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 8:32 pm
by phasma
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.

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 8:48 pm
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, :)

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 9:00 pm
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.

Re: Geyser UI Template

Posted: Fri Oct 04, 2013 11:44 pm
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)>

Re: Geyser UI Template

Posted: Sun Oct 06, 2013 12:39 am
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!..