String to Table?
Posted: Fri Mar 10, 2017 1:44 am
So, I'm making this small little pixel art program that draws according to a table; and the table can be changed by either drawing yourself or dropping a file into the program to draw the file's code. But the small problem is, I can't figure out a way to convert the string into tables.
Example of the File that is Imported
Main.lua: filedropped
But it returns:
Now, I've read other posts and searched online but I just can't seem to make a string into a table and make that into a table.
Example of the File that is Imported
Code: Select all
{ {x,y,colornumber},{x,y,colornumber},{x,y,colornumber},*So on, so on* }
Code: Select all
function love.filedropped(file)
ClearCanvas()
Canvas = file:read()
end
Code: Select all
(table expected, got string)