I can't find a quit() function
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Julian Assange
- Prole
- Posts: 5
- Joined: Sun Dec 19, 2010 3:39 am
- Location: Obey
I can't find a quit() function
What function do I need to use to allow the quit menu in my game to quit the game? I've looked through the documentation for LOVE and LUA, and tried love.quit(), love.exit() etc and haven't seen any way to do this. How do I go about this?
Re: I can't find a quit() function
It's in the native Lua library 'os':
os.quit()
os.quit()
- Julian Assange
- Prole
- Posts: 5
- Joined: Sun Dec 19, 2010 3:39 am
- Location: Obey
Re: I can't find a quit() function
I found that in Google searches, but I get a CSOD that quit is nil.Mud wrote:It's in the native Lua library 'os':
os.quit()
edit:
I (accidentally) found the solution. It doesn't seem to be documented on the wiki but this worked for me:
Code: Select all
love.event.push("q")
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: I can't find a quit() function
Better not use functions from the os table, especially not if you want SELÖVE compatibility.Mud wrote:It's in the native Lua library 'os':
os.quit()
Yeah, that's the proper way to do it.Julian Assange wrote:I (accidentally) found the solution. It doesn't seem to be documented on the wiki but this worked for me:Code: Select all
love.event.push("q")
Help us help you: attach a .love.
Re: I can't find a quit() function
I don't care about SELÖVE compatibility. I don't really understand the point, except perhaps for use on this forum, where we often run scripts from strangers in our local binaries. I feel the same way about the sandboxed file system. *shrug*Robin wrote:Better not use functions from the os table, especially not if you want SELÖVE compatibility.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests