return current dimensions of an object
Posted: Thu Jan 27, 2011 9:49 am
I've been trying to write a function that will automatically create borders around a container.
To do this, I have to first store the information about the container itself into a table, and then create the table based on those values, and THEN run my function that will create the borders.
This is sort of working, but is less than ideal because it requires my entire gui to be within one table, and for the purpose of sharing scripts or using this function on different characters on different muds (or even sharing the function with the whole mudlet community) requiring it to use my namespace isn't really cutting it.
It also means that I must be really careful how I resize the gui element later; if I do it without changing the values in that table, or rerunning the avg.createBorders() function, I end up with misaligned borders that look ridiculous.
Is there a way to return the current position and dimensions of a container?
local posx, posy, sizex, sizey = my.container.name:get_constraints()
^ i.e. something like that?
It isn't in the Geyser documentation that I can see, but I figure it is worth asking because I keep missing stuff and attempting to reinvent the wheel.
To do this, I have to first store the information about the container itself into a table, and then create the table based on those values, and THEN run my function that will create the borders.
This is sort of working, but is less than ideal because it requires my entire gui to be within one table, and for the purpose of sharing scripts or using this function on different characters on different muds (or even sharing the function with the whole mudlet community) requiring it to use my namespace isn't really cutting it.
It also means that I must be really careful how I resize the gui element later; if I do it without changing the values in that table, or rerunning the avg.createBorders() function, I end up with misaligned borders that look ridiculous.
Is there a way to return the current position and dimensions of a container?
local posx, posy, sizex, sizey = my.container.name:get_constraints()
^ i.e. something like that?
It isn't in the Geyser documentation that I can see, but I figure it is worth asking because I keep missing stuff and attempting to reinvent the wheel.