Difference between revisions of "love.event.push"

Line 1: Line 1:
 
Adds an event to the event queue.
 
Adds an event to the event queue.
 
== Function ==
 
== Function ==
{{newin|[[0.8.0]]|080|type=variant}}
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 11: Line 10:
 
{{param|mixed|b (nil)|Second event argument.}}
 
{{param|mixed|b (nil)|Second event argument.}}
 
{{param|mixed|c (nil)|Third event argument.}}
 
{{param|mixed|c (nil)|Third event argument.}}
 +
{{New_feature|0.8.0|
 
{{param|mixed|d (nil)|Fourth event argument.}}
 
{{param|mixed|d (nil)|Fourth event argument.}}
=== Returns ===
+
|080}}
Nothing.
 
== Function ==
 
{{oldin|[[0.8.0]]|080|type=variant}}
 
=== Synopsis ===
 
<source lang="lua">
 
love.event.push( e, a, b, c )
 
</source>
 
=== Arguments ===
 
{{param|Event|e|The type of event.}}
 
{{param|mixed|a (nil)|First event argument.}}
 
{{param|mixed|b (nil)|Second event argument.}}
 
{{param|mixed|c (nil)|Third event argument.}}
 
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.

Revision as of 11:53, 21 October 2012

Adds an event to the event queue.

Function

Synopsis

love.event.push( e, a, b, c, d )

Arguments

Event e
The name of the event.
mixed a (nil)
First event argument.
mixed b (nil)
Second event argument.
mixed c (nil)
Third event argument.
Available since LÖVE 0.8.0
mixed d (nil)
Fourth event argument.

Returns

Nothing.

Examples

Quitting a game in 0.8.0

function love.keypressed(k)
	if k == 'escape' then
		love.event.push('quit') -- Quit the game.
	end	
end

Quitting a game in 0.7.2

function love.keypressed(k)
	if k == 'escape' then
		love.event.push('q') -- Quit the game.
	end	
end

See Also


Other Languages