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.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.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.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.setVisible

love.mouse.setVisible Sets the current visibility of the cursor. Function Synopsis love.mouse.setVisible( visible ) Arguments boolean visible True to set the cursor to visible, false to hide the cursor. Returns Nothing. Examples Toggle mouse visibility by pressing tab. 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.mo

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.setY

love.mouse.setY Available since LÖVE 0.9.0 This function is not supported in earlier versions. Sets the current Y 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.setY( y ) Arguments number y The new position of the mouse along the y-axis. Returns Nothing. See Also love.mouse love.mouse.setPosition love.mouse.setX love.mouse.getY

love.mousefocus

love.mousefocus Available since LÖVE 0.9.0 This callback is not supported in earlier versions. Callback function triggered when window receives or loses mouse focus. Function Synopsis love.mousefocus( focus ) Arguments boolean focus Wether the window has mouse focus or not. Returns Nothing. Example function love.load() text = "Mouse is in the window!" end   function love.draw() love.graphics.print(text,0,0) end   function love.mousefocus(f) if not f then text = "Mouse is not

love.mousemoved

love.mousemoved Available since LÖVE 0.9.2 This function is not supported in earlier versions. Callback function triggered when the mouse is moved. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis love.mousemoved( x, y, dx, dy, istouch ) Arguments number x The mouse position on the x-axis. number y The mouse position on the y-axis. number dx The amount moved along the x-axis since the last time love.mousemoved was called. number dy Th

love.mousepressed

love.mousepressed Callback function triggered when a mouse button is pressed. Function Available since LÖVE 0.10.0 This variant is not supported in earlier versions. Synopsis love.mousepressed( x, y, button, istouch ) Arguments number x Mouse x position, in pixels. number y Mouse y position, in pixels. number button The button index that was pressed. 1 is the primary mouse button, 2 is the secondary mouse button and 3 is the middle button. Further buttons are mouse dependent. boolean is