Start argumets in Love

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
Arthes
Prole
Posts: 10
Joined: Fri Dec 30, 2011 10:52 am

Start argumets in Love

Post by Arthes »

Hello.
How to get the start arguments?
Thanks for replies.

And sorry for my English - I'm from Poland.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Start argumets in Love

Post 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
Help us help you: attach a .love.
Arthes
Prole
Posts: 10
Joined: Fri Dec 30, 2011 10:52 am

Re: Start argumets in Love

Post by Arthes »

It working, thanks ;)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Start argumets in Love

Post by bartbes »

Yeah, we can't recommend using that, the same (/a similar) table is passed as an argument to love.load, though.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Start argumets in Love

Post 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
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests