Difference between revisions of "love.mousemoved"

m
m (Use "New feature" template for `istouch` argument like love.graphics.draw)
Line 2: Line 2:
 
Callback function triggered when the mouse is moved.
 
Callback function triggered when the mouse is moved.
 
== Function ==
 
== Function ==
{{newin|[[0.10.0]]|100|type=variant}}
 
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
Line 12: Line 11:
 
{{param|number|dx|The amount moved along the x-axis since the last time love.mousemoved was called.}}
 
{{param|number|dx|The amount moved along the x-axis since the last time love.mousemoved was called.}}
 
{{param|number|dy|The amount moved along the y-axis since the last time love.mousemoved was called.}}
 
{{param|number|dy|The amount moved along the y-axis since the last time love.mousemoved was called.}}
 +
{{New feature|0.10.0|
 
{{param|boolean|istouch|True if the mouse button press originated from a touchscreen touch-press.}}
 
{{param|boolean|istouch|True if the mouse button press originated from a touchscreen touch-press.}}
=== Returns ===
+
|100}}
Nothing.
 
== Function ==
 
{{oldin|[[0.10.0]]|100|type=variant}}
 
=== Synopsis ===
 
<source lang="lua">
 
love.mousemoved( x, y, dx, dy )
 
</source>
 
=== Arguments ===
 
{{param|number|x|The mouse position on the x-axis.}}
 
{{param|number|y|The mouse position on the y-axis.}}
 
{{param|number|dx|The amount moved along the x-axis since the last time love.mousemoved was called.}}
 
{{param|number|dy|The amount moved along the y-axis since the last time love.mousemoved was called.}}
 
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.

Revision as of 12:48, 29 May 2018

Available since LÖVE 0.9.2
This function is not supported in earlier versions.

Callback function triggered when the mouse is moved.

Function

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
The amount moved along the y-axis since the last time love.mousemoved was called.
Available since LÖVE 0.10.0
boolean istouch
True if the mouse button press originated from a touchscreen touch-press.

Returns

Nothing.

Notes

If Relative Mode is enabled for the mouse, the dx and dy arguments of this callback will update but x and y are not guaranteed to.

See Also


Other Languages