Difference between revisions of "love.mousemoved"

(German Translation.)
(See Also)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{newin|[[0.9.2]]|092|type=function|text=Diese Funktion ist in älteren Versionen nicht vorhanden}}
+
{{newin|[[0.9.2]]|092||type=function}}
Eine Rückruffunktion, welche ausgelöst wird sobald der Mauszeiger bewegt wird.
+
Callback function triggered when the mouse is moved.
== Funktion ==
+
== Function ==
=== Übersicht ===
+
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
love.mousemoved( x, y, dx, dy )
+
love.mousemoved( x, y, dx, dy, istouch )
 
</source>
 
</source>
=== Argumente ===
+
=== Arguments ===
{{param|number (Deutsch)|x|Die Position der Maus auf der x-Achse.}}
+
{{param|number|x|The mouse position on the x-axis.}}
{{param|number (Deutsch)|y|Die Position der Maus auf der y-Achse.}}
+
{{param|number|y|The mouse position on the y-axis.}}
{{param|number (Deutsch)|dx|Die Distanz welche die Maus in x-Richtung überbrückt hat, seit [[love.mousemoved (Deutsch)|love.mousemoved]] das letzte Mal aufgerufen wurde.}}
+
{{param|number|dx|The amount moved along the x-axis since the last time love.mousemoved was called.}}
{{param|number (Deutsch)|dy|Die Distanz welche die Maus in y-Richtung überbrückt hat, seit [[love.mousemoved (Deutsch)|love.mousemoved]] das letzte Mal aufgerufen wurde.}}
+
{{param|number|dy|The amount moved along the y-axis since the last time love.mousemoved was called.}}
=== Rückgabewerte ===
+
{{New feature|0.10.0|
Keine.
+
{{param|boolean|istouch|True if the mouse button press originated from a touchscreen touch-press.}}
== Anmerkungen ==
+
|100}}
Wenn der [[love.mouse.setRelativeMode (Deutsch)|relative Modus]] für die Maus aktiviert ist, werden nur die '''dx''' und '''dy''' Argumente, nicht aber '''x''' und '''y''' aktualisiert.
+
=== Returns ===
== Siehe auch ==
+
Nothing.
* [[parent::love (Deutsch)|love]]
+
== Notes ==
* [[love.mousepressed (Deutsch)|love.mousepressed]]
+
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.
* [[love.mousereleased (Deutsch)|love.mousereleased]]
+
 
* [[love.mouse.setPosition (Deutsch)|love.mouse.setPosition]]
+
 
* [[love.mouse.getPosition (Deutsch)|love.mouse.getPosition]]
+
== Examples ==
* [[love.mouse.setRelativeMode (Deutsch)|love.mouse.setRelativeMode]]
+
Position a string ("Text") wherever the mouse, also the delta x and y.
* [[love.mouse.getRelativeMode (Deutsch)|love.mouse.getRelativeMode]]
+
<source lang="lua">
 +
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
 +
</source>
 +
 
 +
== See Also ==
 +
* [[parent::love]]
 +
* [[love.mouse]]
 +
* [[love.mousepressed]]
 +
* [[love.mousereleased]]
 +
* [[love.mouse.setPosition]]
 +
* [[love.mouse.getPosition]]
 +
* [[love.mouse.setRelativeMode]]
 +
* [[love.mouse.getRelativeMode]]
 +
* [[love.mouse.isDown]]
 
[[Category:Callbacks]]
 
[[Category:Callbacks]]
{{#set:Description=Eine Rückruffunktion, welche ausgelöst wird sobald der Mauszeiger bewegt wird.}}
+
{{#set:Description=Callback function triggered when the mouse is moved.}}
{{#set:Subcategory=General}}
+
{{#set:Subcategory=Mouse}}
== Andere Sprachen ==
+
 
 +
== Other Languages ==
 
{{i18n|love.mousemoved}}
 
{{i18n|love.mousemoved}}

Latest revision as of 15:26, 2 February 2023

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.


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


Other Languages