Difference between revisions of "love.event.poll"

m (Added the 1+6 parameter version that's used from 0.10.0 onwards; to keep it consistent, i renamed the first parameter away from e, for the latest one.)
m (Forgot a closing tag...)
Line 17: Line 17:
 
end
 
end
 
end
 
end
 +
</source>
 
=== Checking for events in 0.8.0 ===
 
=== Checking for events in 0.8.0 ===
 
<source lang="lua">
 
<source lang="lua">

Revision as of 15:08, 21 June 2017

Returns an iterator for messages in the event queue.

Function

Synopsis

i = love.event.poll( )

Arguments

None.

Returns

function i
Iterator function usable in a for loop.

Examples

Checking for events in 0.10.0

for n, a, b, c, d, e, f in love.event.poll() do
	if n == "quit" then
		-- Quit!
	end	
end

Checking for events in 0.8.0

for e, a, b, c, d in love.event.poll() do
	if e == "quit" then
		-- Quit!
	end	
end

Checking for events in 0.7.2

for e, a, b, c in love.event.poll() do
	if e == "q" then
		-- Quit!
	end	
end

See Also


Other Languages