Printing 0?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Printing 0?

Post 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?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Printing 0?

Post 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?
badfitz66
Prole
Posts: 30
Joined: Sat Jun 07, 2014 10:30 pm

Re: Printing 0?

Post by badfitz66 »

here
Attachments
Problems.love
^
(1.23 KiB) Downloaded 127 times
User avatar
Xrott
Prole
Posts: 16
Joined: Thu Aug 15, 2013 1:28 pm
Location: Augsburg

Re: Printing 0?

Post 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
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 15 guests