Available since LÖVE 0.9.0
This function is not supported in earlier versions.
Sets the current mouse cursor.
love.mouse.setCursor( cursor )
Cursor cursor
Nothing.
love.mouse.setCursor( )
None.
Nothing.
Resets the current mouse cursor to the default.
function love.load() cursor = love.mouse.getSystemCursor("hand") -- Alternative: cursor = love.mouse.newCursor("pig.png", 0, 0) end function love.mousepressed(x, y, button) -- Use a custom cursor when the left mouse button is pressed. if button == 1 then love.mouse.setCursor(cursor) end end function love.mousereleased(x, y, button) -- Go back to the default cursor when the left mouse button is released. if button == 1 then love.mouse.setCursor() end end
© 2006–2016 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.mouse.setCursor