Difference between revisions of "love.event.poll"

m (Modified example code to love.event instead of love.events)
Line 12: Line 12:
 
=== Checking for events ===
 
=== Checking for events ===
 
<source lang="lua">
 
<source lang="lua">
for e,a,b,c in love.events.poll() do
+
for e,a,b,c in love.event.poll() do
 
if e == "q" then
 
if e == "q" then
 
-- Quit!
 
-- Quit!

Revision as of 00:53, 8 December 2011

Gets an iterator for messages in the event queue.

Function

Synopsis

i = love.event.poll( )

Arguments

None.

Returns

function i
Iterator function usable in for loop.

Examples

Checking for events

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

See Also


Other Languages