I found in the default love.run function, love.load is called with 'arg', which seems to be a table containing all the switches passed in when a game is started. I was able to find out that much on my own, but I was wondering a few other details so that i can use them in a completed game.
For instance: The switches are divided into positive and negative indexes. Negative indexes are switches I did not pass in, but rather the ones love is passing into itself. The two that keep appearing are '-1 embedded boot.lua' and '-2 bin\CLF.exe' which is the directory of my fused game. I was wondering what might be the purpose of these two, and will any more negative indexes appear under special circumstances.
Another questions is the consistency of the order of switches. If I start my games as such:
Code: Select all
bin\CLF.exe -nonetwork -debug -width 1280 -height 720
Code: Select all
arg = {
[-2] = "bin\CLF.exe"
[-1] = "embedded boot.lua"
[1] = "-nonetwork"
[2] = "-debug"
[3] = "-width"
[4] = "1280"
[5] = "-height"
[6] = "720"
}
Both questions aren't of the highest importance, because i can do with out this functionality, but I am rather curious because I cant find a page on the love wiki or anywhere else describing the behavior of the 'arg' table that is passed in, and it would be nice if i could use them. If anyone can tell me how it all works, or point me to the right location, i would really appreciate it. I don't want to use it in my games if im not sure how they work entirely.