Difference between revisions of "love.event.poll"
Hypernexus (talk | contribs) m (Modified example code to love.event instead of love.events) |
(Updated example.) |
||
Line 1: | Line 1: | ||
− | + | Returns an iterator for messages in the event queue. | |
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 8: | Line 8: | ||
None. | None. | ||
=== Returns === | === Returns === | ||
− | {{param|function|i|Iterator function usable in for loop.}} | + | {{param|function|i|Iterator function usable in a for loop.}} |
== Examples == | == Examples == | ||
=== Checking for events === | === Checking for events === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | for e,a,b,c in love.event.poll() do | + | for e, a, b, c, d in love.event.poll() do |
− | if e == " | + | if e == "quit" then |
-- Quit! | -- Quit! | ||
end | end | ||
Line 22: | Line 22: | ||
* [[love.event.wait]] | * [[love.event.wait]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description= | + | {{#set:Description=Returns an iterator for messages in the event queue.}} |
{{#set:Since=000}} | {{#set:Since=000}} | ||
== Other Languages == | == Other Languages == | ||
{{i18n|love.event.poll}} | {{i18n|love.event.poll}} |
Revision as of 22:07, 8 April 2012
Returns an iterator for messages in the event queue.
Contents
Function
Synopsis
i = love.event.poll( )
Arguments
None.
Returns
function i
- Iterator function usable in a for loop.
Examples
Checking for events
for e, a, b, c, d in love.event.poll() do
if e == "quit" then
-- Quit!
end
end
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info