Available since LÖVE 0.6.0
This function is not supported in earlier versions.
Like love.event.poll(), but blocks until there is an event in the queue.
n, a, b, c, d, e, f, ... = love.event.wait( )
None.
Event n (nil)Variant aVariant bVariant cVariant d Available since 0.8.0
Variant e Available since 0.10.0
Variant f Available since 0.10.0
Variant ... Available since 0.10.0
An example that replace love.event.poll() with this function.
function love.run()
if love.load then love.load(love.arg.parseGameArguments(arg), arg) end
-- Main loop time.
return function()
-- Process events.
if love.event then
local name, a,b,c,d,e,f = love.event.wait()
if name then
if name == "quit" then
if not love.quit or not love.quit() then
return a or 0
end
end
love.handlers[name](a,b,c,d,e,f)
end
end
-- Call update and draw
if love.update then love.update(0) end
if love.graphics and love.graphics.isActive() then
love.graphics.origin()
love.graphics.clear(love.graphics.getBackgroundColor())
if love.draw then love.draw() end
love.graphics.present()
end
end
end
© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.event.wait