love.mouse.setX

love.mouse.setX Available since LÖVE 0.9.0 This function is not supported in earlier versions. Sets the current X position of the mouse. The coordinates of the mouse pointer are always whole numbers, but even if you try setting a non-integer, löve will floor it internally. Function Synopsis love.mouse.setX( x ) Arguments number x The new position of the mouse along the x-axis. Returns Nothing. See Also love.mouse love.mouse.setPosition love.mouse.setY love.mouse.getX

love.mouse.setRelativeMode

love.mouse.setRelativeMode Available since LÖVE 0.9.2 This function is not supported in earlier versions. Sets whether relative mode is enabled for the mouse. When relative mode is enabled, the cursor is hidden and doesn't move when the mouse does, but relative mouse motion events are still generated via love.mousemoved. This lets the mouse move in any direction indefinitely without the cursor getting stuck at the edges of the screen. The reported position of the mouse may not be updated

love.mouse.setPosition

love.mouse.setPosition Sets the current position of the mouse. The coordinates of the mouse pointer are always whole numbers, but even if you try setting a non-integer, löve will floor it internally. Function Synopsis love.mouse.setPosition( x, y ) Arguments number x The new position of the mouse along the x-axis. number y The new position of the mouse along the y-axis. Returns Nothing. Examples Snap the mouse to the horizontal center of the screen while maintaining the coordinate along t

love.mouse.setGrabbed

love.mouse.setGrabbed Available since LÖVE 0.9.0 It has been renamed from love.mouse.setGrab. Grabs the mouse and confines it to the window. Function Synopsis love.mouse.setGrabbed( grab ) Arguments boolean grab True to confine the mouse, false to let it leave the window. Returns Nothing. Examples Toggles whether the mouse is grabbed by pressing tab, with the help of love.mouse.isGrabbed. function love.keypressed(key) if key == "tab" then local state = not love.mouse.isGrabbe

love.mouse.setGrab

love.mouse.setGrab Removed in LÖVE 0.9.0 It has been renamed to love.mouse.setGrabbed. Grabs the mouse and confines it to the window. Function Synopsis love.mouse.setGrab( grab ) Arguments boolean grab True to confine the mouse, false to let it leave the window. Returns Nothing. Examples Toggles whether the mouse is grabbed by pressing tab, with the help of love.mouse.isGrabbed. function love.keypressed(key) if key == "tab" then local state = not love.mouse.isGrabbed() -- t

love.mouse.setCursor

love.mouse.setCursor Available since LÖVE 0.9.0 This function is not supported in earlier versions. Sets the current mouse cursor. Function Synopsis love.mouse.setCursor( cursor ) Arguments Cursor cursor The Cursor object to use as the current mouse cursor. Returns Nothing. Function Synopsis love.mouse.setCursor( ) Arguments None. Returns Nothing. Notes Resets the current mouse cursor to the default. Examples function love.load() cursor = love.mouse.getSystemCursor("hand") -

love.mouse.newCursor

love.mouse.newCursor Available since LÖVE 0.9.0 This function is not supported in earlier versions. Creates a new hardware Cursor object from an image file or ImageData. Hardware cursors are framerate-independent and work the same way as normal operating system cursors. Unlike drawing an image at the mouse's current coordinates, hardware cursors never have visible lag between when the mouse is moved and when the cursor position updates, even at low framerates. The hot spot is the point th

love.mouse.isVisible

love.mouse.isVisible Checks if the cursor is visible. Function Synopsis visible = love.mouse.isVisible( ) Arguments None. Returns boolean visible True if the cursor to visible, false if the cursor is hidden. Examples Toggle mouse visibility by pressing tab (using setVisible). function love.keypressed(key) if key == "tab" then local state = not love.mouse.isVisible() -- the opposite of whatever it currently is love.mouse.setVisible(state) end end See Also love.mouse

love.mouse.isGrabbed

love.mouse.isGrabbed Checks if the mouse is grabbed. Function Synopsis grabbed = love.mouse.isGrabbed( ) Arguments None. Returns boolean grabbed True if the cursor is grabbed, false if it is not. Examples Toggles whether the mouse is grabbed by pressing tab, using love.mouse.setGrabbed. function love.keypressed(key) if key == "tab" then local state = not love.mouse.isGrabbed() -- the opposite of whatever it currently is love.mouse.setGrabbed(state) --Use love.mouse.setGra

love.mouse.isDown

love.mouse.isDown Checks whether a certain mouse button is down. This function does not detect mouse wheel scrolling; you must use the love.wheelmoved (or love.mousepressed in version 0.9.2 and older) callback for that. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis down = love.mouse.isDown( button, ... ) Arguments number button The index of a button to check. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the mid