Posted 28 April 2018 - 08:05 PM
Background images (images as big as the terminal drawed at 1, 1) are also part of my GUI API, Graphics. The paintutils.drawImage() call doesn't seem to work, tho. It gives "graphics:232: bad argument #1 (expected table, got nil)".
Background image part of the API:
Program used:
Background image part of the API:
backgroundimg = {
path = "",
new = function(self)
local new = {}
setmetatable(new, {__index = self})
return new
end,
draw = function(self)
local image = paintutils.loadImage(self.path)
paintutils.drawImage(image, 1, 1) --line 232 AKA the error line
end
}
Program used:
local fBCD = fs.open("Boot/bcd.ini", "r")
local bcd = textutils.unserialize(fBCD.readAll())
fBCD.close()
os.loadAPI("DoorOS/apis/graphics")
local splash = graphics.backgroundimg:new()
splash.path = "Boot/bootscreen.npf"
splash:draw()
read()
Edited on 01 May 2018 - 08:50 AM