Function
love.mouse.setPosition( x, y )
Sets the current position of the mouse. Note that this generates a mousemoved event. If you just want to confine the mouse to the screen area, take a look at love.system.grabInput.
Synopsis
love.mouse.setPosition( x, y )
Arguments
x The new x-position.
y The new y-position.
Returns
(Nothing)
Examples
Example 4: Setting the mouse position
  1. -- Example: Setting the mouse position 
  2.  
  3. -- Press a key to move the mouse to 
  4. -- some random point. 
  5. function keypressed(k) 
  6.     local x, y = math.random(0,800), math.random(0,600
  7.     love.mouse.setPosition(x, y) 
  8. end 
Copyright © 2006-2008 LÖVE Development Team.