Difference between revisions of "love.event.push"

(love.event uses Variant, and doesn't accept all types)
(Updated page to account the two parameter slots added because of touch events in 0.10.0.)
Line 3: Line 3:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.event.push( e, a, b, c, d )
+
love.event.push( n, a, b, c, d, e, f )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
Line 13: Line 13:
 
{{param|Variant|d (nil)|Fourth event argument.}}
 
{{param|Variant|d (nil)|Fourth event argument.}}
 
|080}}
 
|080}}
 +
{{New_feature|0.10.0|
 +
{{param|Variant|e (nil)|Fifth event argument.}}
 +
{{param|Variant|f (nil)|Sixth event argument.}}
 +
|100}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.

Revision as of 15:05, 21 June 2017

Adds an event to the event queue.

Function

Synopsis

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

Arguments

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


Available since LÖVE 0.10.0
Variant e (nil)
Fifth event argument.
Variant f (nil)
Sixth 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