return table problem
Posted: Tue Sep 01, 2009 8:32 pm
I'm making a GUI library and I get error LFrame is nil value. Frame is a table in a other file(which is included in the GUI library)
Main Program:
GuiLibrary:
Main Program:
Code: Select all
require('GUI.lua')
function load()
local var = love.graphics.newImage('test.gif')
LFrame = GUI:Create('Frame')
LFrame:SetPos(10,10)
LFrame:SetSize(100,100)
LFrame:SetTitle('TEST')
LFrame:SetBackgroundPic(var)
LFrame:Show(true)
end
Code: Select all
GUI = {
Create = function(obj)
if obj == 'Frame' or obj == 'Window' then
c = {}
for k, v in pairs(Frame) do
c[k] = Frame[k]
end
end
Objects[#Objects + 1] = c
return c
end,
-- more code
}