Page 1 of 1

Printing 0?

Posted: Wed Aug 27, 2014 3:20 pm
by badfitz66
amount = #objects
love.graphics.print("Number of objects: "..amount, 10, 20)


I add amount to the end of adding 4 objects into the scene, it still says 0, why?

Re: Printing 0?

Posted: Wed Aug 27, 2014 4:20 pm
by micha
It is very difficult for us to help without the context. Could you please upload a .love file of your code, so we can look inside?

Re: Printing 0?

Posted: Wed Aug 27, 2014 4:44 pm
by badfitz66
here

Re: Printing 0?

Posted: Wed Aug 27, 2014 5:34 pm
by Xrott
"#" works only with tables that have their keys in sequence (table[1], table[2], table[3]...)
http://www.lua.org/manual/5.2/manual.html#3.4.6