Returns the current position of the mouse.
x, y = love.mouse.getPosition( )
None.
number xnumber yfunction love.load()
love.mouse.setVisible(false) -- make default mouse invisible
img = love.graphics.newImage("mouse.png") -- load in a custom mouse image
end
function love.draw()
local x, y = love.mouse.getPosition() -- get the position of the mouse
love.graphics.draw(img, x, y) -- draw the custom mouse image
end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.mouse.getPosition