love.quit

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 readyToQuit = false

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

See Also


Other Languages