Difference between revisions of "love.mousemoved"

m
m
(5 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
=== Synopsis ===
 
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.mousemoved( x, y, dx, dy )
+
love.mousemoved( x, y, dx, dy, istouch )
 
</source>
 
</source>
 
=== Arguments ===
 
=== Arguments ===
{{param|number|x|Mouse x position.}}
+
{{param|number|x|The mouse position on the x-axis.}}
{{param|number|y|Mouse y position.}}
+
{{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|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.}}
 +
|100}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 
== Notes ==
 
== Notes ==
If [[love.mouse.setRelativeMode|Relative Mode]] is enabled for the mouse, the '''dx''' and '''dy''' arguments of this callback will update but '''x''' and '''y''' will not.
+
If [[love.mouse.setRelativeMode|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 ==
 
== See Also ==
 
* [[parent::love]]
 
* [[parent::love]]
Line 25: Line 28:
 
[[Category:Callbacks]]
 
[[Category:Callbacks]]
 
{{#set:Description=Callback function triggered when the mouse is moved.}}
 
{{#set:Description=Callback function triggered when the mouse is moved.}}
{{#set:Subcategory=General}}
+
{{#set:Subcategory=Mouse}}
 
== Other Languages ==
 
== Other Languages ==
 
{{i18n|love.mousemoved}}
 
{{i18n|love.mousemoved}}

Revision as of 22:28, 7 March 2019

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