|
|
Function
love.mouse.isDown( button )
Checks whether a certain mouse button is down.
Synopsis
down = love.mouse.isDown( button )
Arguments
button
A mouse button.
Returns
boolean
Whether the button is down.
See Also
Examples
Example 5: Checking for pressed mouse buttons
function load() local f = love.graphics.newFont(love.default_font, 14) love.graphics.setFont(f) end function draw() -- Left mouse button. if love.mouse.isDown(love.mouse_left) then love.graphics.draw("Left mouse button is down", 50, 50) end -- Right mouse button. if love.mouse.isDown(love.mouse_right) then love.graphics.draw("Right mouse button is down", 50, 100) end end
Copyright © 2006-2008 LÖVE Development Team.
|