Difference between revisions of "love.event.poll"

 
Line 1: Line 1:
 
{{newin|[[0.6.0]]|060|type=function}}
 
{{newin|[[0.6.0]]|060|type=function}}
Возвращает итератор для сообщений в очереди событий.
+
Returns an iterator for messages in the event queue.
== Функция ==
+
== Function ==
=== Синопсис ===
+
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
 
i = love.event.poll( )
 
i = love.event.poll( )
 
</source>
 
</source>
=== Аргументы ===
+
=== Arguments ===
Нет.
+
None.
=== Возвращает ===
+
=== Returns ===
{{param|function|i|Функция для использования в качестве итератора в цикле for.}}
+
{{param|function|i|Iterator function usable in a for loop.}}
== Пример ==
+
== Examples ==
=== Проверка на наличие событий в 0.10.0 ===
+
=== Checking for events in 0.10.0 ===
 
<source lang="lua">
 
<source lang="lua">
 
for n, a, b, c, d, e, f in love.event.poll() do
 
for n, a, b, c, d, e, f in love.event.poll() do
 
if n == "quit" then
 
if n == "quit" then
-- Выйти!
+
-- Quit!
 
end
 
end
 
end
 
end
 
</source>
 
</source>
=== Проверка на наличие событий в 0.8.0 ===
+
=== Checking for events in 0.8.0 ===
 
<source lang="lua">
 
<source lang="lua">
 
for e, a, b, c, d in love.event.poll() do
 
for e, a, b, c, d in love.event.poll() do
 
if e == "quit" then
 
if e == "quit" then
-- Выйти!
+
-- Quit!
 
end
 
end
 
end
 
end
 
</source>
 
</source>
=== Проверка на наличие событий в 0.7.2 ===
+
=== Checking for events in 0.7.2 ===
 
<source lang="lua">
 
<source lang="lua">
 
for e, a, b, c in love.event.poll() do
 
for e, a, b, c in love.event.poll() do
 
if e == "q" then
 
if e == "q" then
-- Выйти!
+
-- Quit!
 
end
 
end
 
end
 
end
 
</source>
 
</source>
== Смотри также ==
+
== See Also ==
* [[parent::love.event (Русский)]]
+
* [[parent::love.event]]
* [[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 ==
 
{{i18n|love.event.poll}}
 
{{i18n|love.event.poll}}

Latest revision as of 22:33, 17 November 2019

Available since LÖVE 0.6.0
This function is not supported in earlier versions.

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