Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local gui_server = {
- children = nil;
- width = 100; -- %
- height = 100; -- %
- parent = nil;
- }
- gui_server.__index = gui_server
- local function createGUIServer(w, h, c)
- local t = {
- width = w;
- height = h;
- }
- t.children = (c == nil or type(c) ~= "table") and {} or c;
- setmetatable(t, gui_server)
- return t
- end
- function gui_server:addChild(c)
- end
- function gui_sever:pxSize()
- if self.parent == nil then
- local w, h = term.getSize()
- return math.round(w / 100 * self.width), math.round(h / 100 * self.height)
- end
- local w, h = self.parent:pxSize()
- return math.round(w / 100 * self.width), math.round(h / 100 * self.height)
- end
Advertisement
Add Comment
Please, Sign In to add comment