Posted 25 May 2012 - 03:45 AM
Heya… I have trouble with some code, for some reason it doesn't work for me. It says it's trying to index ? (a nil value)
This is what I'm doing:
file named gfx (an api)
My 'runnable' file
I know the gfx functions work if I'm just plotting in numbers. But I'm getting that error when I do local w,h = gfx.getSize()
This is what I'm doing:
file named gfx (an api)
local w,h = term.getSize()
function getSize()
w,h = term.getSize()
return w,h
end
My 'runnable' file
os.loadAPI(apiDir.."pvar")
os.loadAPI(apiDir.."gfx")
function drawTermScreen()
term.clear()
local w,h = gfx.getSize()
gfx.outlineBox("*", 1, 1, w / 2, h) --Left side box
gfx.outlineBox("*", w / 2 + 1, 1, w, h / 2) --Right upper side box
gfx.outlineBox("*", w / 2 + 1, h / 2 + 1, w, h) --Right side lower box
end
drawTermScreen()
os.unloadAPI(apiDir.."pvar")
os.unloadAPI(apiDir.."gfx")
I know the gfx functions work if I'm just plotting in numbers. But I'm getting that error when I do local w,h = gfx.getSize()