Page 1 of 1

Start argumets in Love

Posted: Fri Dec 30, 2011 11:09 am
by Arthes
Hello.
How to get the start arguments?
Thanks for replies.

And sorry for my English - I'm from Poland.

Re: Start argumets in Love

Posted: Fri Dec 30, 2011 11:23 am
by Robin
You mean the command line arguments?

I've used the table arg, but that might be deprecated.

main.lua:

Code: Select all

print(unpack(arg))
command line:

Code: Select all

$ love . 1 2 3
.	1	2	3

Re: Start argumets in Love

Posted: Fri Dec 30, 2011 11:37 am
by Arthes
It working, thanks ;)

Re: Start argumets in Love

Posted: Fri Dec 30, 2011 12:08 pm
by bartbes
Yeah, we can't recommend using that, the same (/a similar) table is passed as an argument to love.load, though.

Re: Start argumets in Love

Posted: Fri Dec 30, 2011 12:34 pm
by Robin
bartbes wrote:Yeah, we can't recommend using that, the same (/a similar) table is passed as an argument to love.load, though.
Oh, right.

Forget what I said earlier and use:

Code: Select all

function love.load(arg)
    print(unpack(arg))
end