Difference between revisions of "love.mouse.isDown"

Line 9: Line 9:
 
=== Returns ===
 
=== Returns ===
 
{{param|boolean|down|True if the specified button is down.}}
 
{{param|boolean|down|True if the specified button is down.}}
=== Example ===
+
== Function ==
 +
{{newin|[[0.7.2]]|type=variant}}
 +
=== Synopsis ===
 +
<source lang="lua">
 +
anyDown = love.mouse.isDown( button1, button2, button3, ... )
 +
</source>
 +
=== Arguments ===
 +
{{param|MouseConstant|buttonN|A button to check.}}
 +
=== Returns ===
 +
{{param|boolean|anyDown|True if any specified button is down, false otherwise.}}
 +
== Example ==
 
<source lang="lua">
 
<source lang="lua">
 
if love.mouse.isDown("r") then
 
if love.mouse.isDown("r") then

Revision as of 15:57, 6 April 2011

Checks whether a certain button is down.

Function

Synopsis

down = love.mouse.isDown( button )

Arguments

MouseConstant button
The button to check.

Returns

boolean down
True if the specified button is down.

Function

Available since LÖVE 0.7.2
This variant is not supported in earlier versions.

Synopsis

anyDown = love.mouse.isDown( button1, button2, button3, ... )

Arguments

MouseConstant buttonN
A button to check.

Returns

boolean anyDown
True if any specified button is down, false otherwise.

Example

if love.mouse.isDown("r") then
   -- do something awesome
end

See Also


Other Languages