Difference between revisions of "love.mouse.setRelativeMode"

(Created page)
 
m
Line 2: Line 2:
 
Sets whether relative mode is enabled for the mouse.
 
Sets whether relative mode is enabled for the mouse.
  
When relative mode is enabled, the cursor is hidden and it stops moving, 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.
+
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 is not updated while relative mode is enabled, even when relative mouse [[love.mousemoved|motion events]] are generated.
 
The reported position of the mouse is not updated while relative mode is enabled, even when relative mouse [[love.mousemoved|motion events]] are generated.

Revision as of 03:33, 9 February 2015

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 is not updated while relative mode is enabled, even when relative mouse motion events are generated.

Function

Synopsis

love.mouse.setRelativeMode( enable )

Arguments

boolean enable
True to enable relative mode, false to disable it.

Returns

Nothing.

See Also

Other Languages