Difference between revisions of "love.quit"

(Fixed newin tag to newinoldin, to show it has been renamed/moved.)
m (Undo revision 15987 by Zorg (talk) -- nevermind)
Line 1: Line 1:
{{newinoldin|[[0.7.0]]|070|[[0.8.0]]|080|type=callback|text=It has been renamed to [[love.event.quit]]}}
+
{{newin|[[0.7.0]]|070|type=callback}}
 
Callback function triggered when the game is closed.
 
Callback function triggered when the game is closed.
 
== Function ==
 
== Function ==

Revision as of 08:56, 30 December 2015

Available since LÖVE 0.7.0
This callback is not supported in earlier versions.

Callback function triggered when the game is closed.

Function

Synopsis

r = love.quit( )

Arguments

None.

Returns

boolean r
Abort quitting. If true, do not close the game.

Example

This example shows how the return value of love.quit can be used to stop the closing of the game.

local quit = true;
function love.quit()
    if quit then
        print('We are not ready to quit yet!');
        quit = not quit;
    else
        print('Thanks for playing. Please play again soon!');
        return quit;
    end
    return true;
end

See Also


Other Languages