2: Likewise both the love2d wiki tutorials and the Lua reference manual and tutorials (and I have a hardcopy of the 5.1 Progamming in Lua book to boot)
3: I'm sure I am overthinking this and making it way more difficult than it actually is.
(These examples are from a love2d tutorial)
Here is a table:
Code: Select all
function love.load()
MyGlobalTable = {
{ 'Stuff inside a sub-table', 'More stuff inside a sub-table' },
{ 'Stuff inside the second sub-table', 'Even more stuff' }
}
end
Code: Select all
function love.draw()
for i,subtable in ipairs(MyGlobalTable) do
for j,elem in ipairs(subtable) do
love.graphics.print(elem, 100 * i, 50 * j)
end
end
end
2: If i wanted to read the whole table, but only print 'Even more stuff', how would I do that?
3: Right now, it will display like this:
Code: Select all
Stuff inside a sub-table Stuff inside a second sub-table
More stuff inside a sub-table Even more stuff
Code: Select all
Stuff inside a sub-table More stuff inside a sub-table
Stuff inside a second sub-table Even more stuff