Module
love.mouse
Keeps track of the state of the mouse.
Functions
getX( ) Gets the current x-position of the mouse.
getY( ) Gets the current y-position of the mouse.
getPosition( ) Gets the current position of the mouse.
setPosition( x, y ) Sets the current position of the mouse.
isDown( button ) Checks whether a certain button is down.
setVisible( visible ) Controls cursor visbility.
isVisible( ) Checks cursor visbility.
Examples
Example 2: Getting the mouse position
  1. -- Example: Getting the mouse position 
  2.  
  3. function load() 
  4.     local f = love.graphics.newFont(love.default_font, 14
  5.     love.graphics.setFont(f) 
  6. end 
  7.  
  8. function draw() 
  9.     -- Gets the x- and y-position of the mouse. 
  10.     local x, y = love.mouse.getPosition() 
  11.     -- Draws the position on screen. 
  12.     love.graphics.draw("The mouse is at (" .. x .. "," .. y .. ")"5050
  13. end 
Copyright © 2006-2008 LÖVE Development Team.