Callback function triggered when a mouse button is pressed.
Available since LÖVE 0.10.0
This variant is not supported in earlier versions.
love.mousepressed( x, y, button, istouch )
number x
number y
number button
boolean istouch
Nothing.
Use love.wheelmoved to detect mouse wheel motion. It will not register as a button press in version 0.10.0 and newer.
Removed in LÖVE 0.10.0
This variant is not supported in that and later versions.
love.mousepressed( x, y, button )
number x
number y
MouseConstant button
Nothing.
Position a string ("Text") wherever the user left-clicks.
function love.load() printx = 0 printy = 0 end function love.draw() love.graphics.print("Text", printx, printy) end function love.mousepressed(x, y, button, istouch) if button == 1 then -- Versions prior to 0.10.0 use the MouseConstant 'l' printx = x printy = y end end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.mousepressed