The love documentation does not make it clear when you should use the love.load() callback versus just putting your initialization code at the top of the main.lua file. I know that love.load gives you access to the command line arguments and that you can declare local variables that will be accessible throughout the various callbacks at the top of the script but not in love.load, but apart from that, what is the difference?
I suppose my point is, what is the use of love.load() apart from giving access to the command line arguments?
Purpose of love.load() vs top of main.lua
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Purpose of love.load() vs top of main.lua
love.load had more of a purpose in some older love versions because some things used to be initialized after main.lua is loaded and before love.load is called. But most or all of those have been changed to initialize earlier in modern love versions, so love.load isn't too useful these days if you don't need parsed command line arguments. (the global arg table also has un-parsed CLI args.)
Re: Purpose of love.load() vs top of main.lua
Thanks for the clarification.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest