I have been playing around with it a bit and I tested it last night and it gave the results shown above but I tried it just now and it worked...weird i must have made an error somewhere and fixed it when re-tying some of the lines of code as i had messed around with them a bit. Well thanks anyway for the help, here is the working code for anyone who finds this thread of use in the future for OOP in lua:
local version = "V1.0"
local Render = {width = 640, height = 640, peripheral = nil, setPeripheral = function(self, name) self.peripheral = name end}
function help()
print("OpenPeripheral Render API "..version.." by Redstonedude")
end
function setPeripheral2(self,name)
self.peripheral = name
end
function getPeripheral(self)
return self.peripheral
end
function newRender (p)
if peripheral.getType(p) == "openperipheral_glassesbridge" then
return setmetatable({},{__index=Render})
else
error("Peripheral is not an Openperipheral Glasses Bridge",2)
end
end