love.mousemoved
Available since LÖVE 0.9.2 |
This function is not supported in earlier versions. |
Callback function triggered when the mouse is moved.
Contents
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.
Examples
Position a string ("Text") wherever the mouse, also the delta x and y.
function love.load()
printx = 0
printy = 0
printdx = 0
printdy = 0
end
function love.draw()
love.graphics.print("Text", printx, printy)
love.graphics.print('dx: '..printdx .. ' dy: '.. printdy, 0, 0)
end
function love.mousemoved( x, y, dx, dy, istouch )
printx = x
printy = y
printdx = dx
printdy = dy
end
See Also
- love
- love.mouse
- love.mousepressed
- love.mousereleased
- love.mouse.setPosition
- love.mouse.getPosition
- love.mouse.setRelativeMode
- love.mouse.getRelativeMode
- love.mouse.isDown
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info