Now, I am a bit of a beginner when it comes to Lua, so I apologize if the problem is something overly simple, however, this is the longest I've ever been stuck in programming.
Code: Select all
local DrawList = {}
function DrawList.newDrawList()
this = {}
this.queue = {} -- This is the table
print(#this.queue) -- Prints 0
function this.add(image)
print(#this.queue) -- Error
this.queue[#this.queue+1] = image
image.drawNum = #this.queue
end
return this
end
return DrawList