Difference between revisions of "love.mouse.setPosition"

m (Shorten description.)
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
마우스의 위치를 설정합니다.
+
Sets the current position of the mouse. Non-integer values are floored.
== 함수 ==
+
== Function ==
=== 형식 ===
+
=== Synopsis ===
 
<source lang="lua">
 
<source lang="lua">
 
love.mouse.setPosition( x, y )
 
love.mouse.setPosition( x, y )
 
</source>
 
</source>
=== 매개변수 ===
+
=== Arguments ===
{{param|number (한국어)|x|마우스의 x좌표.}}
+
{{param|number|x|The new position of the mouse along the x-axis.}}
{{param|number (한국어)|y|마우스의 y좌표.}}
+
{{param|number|y|The new position of the mouse along the y-axis.}}
=== 리턴값 ===
+
=== Returns ===
없음.
+
Nothing.
== 다른 언어 ==
+
== Examples ==
* [[parent::love.mouse (한국어)]]
+
Snap the mouse to the horizontal center of the screen while maintaining the coordinate along the y-axis by using [[love.mouse.getY]].
* [[love.mouse.getPosition (한국어)]]
+
<source lang="lua">
* [[love.mouse.getX (한국어)]]
+
function love.keypressed( )
* [[love.mouse.getY (한국어)]]
+
  love.mouse.setPosition( love.graphics.getWidth() * 0.5, love.mouse.getY() )
 +
end
 +
</source>
 +
== See Also ==
 +
* [[parent::love.mouse]]
 +
* [[love.mouse.getPosition]]
 +
* [[love.mouse.getX]]
 +
* [[love.mouse.getY]]
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=마우스의 위치를 설정합니다.}}
+
{{#set:Description=Sets the current position of the mouse.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
== 다른 언어 ==
+
== Other Languages ==
 
{{i18n|love.mouse.setPosition}}
 
{{i18n|love.mouse.setPosition}}

Latest revision as of 09:34, 10 March 2017

Sets the current position of the mouse. Non-integer values are floored.

Function

Synopsis

love.mouse.setPosition( x, y )

Arguments

number x
The new position of the mouse along the x-axis.
number y
The new position of the mouse along the y-axis.

Returns

Nothing.

Examples

Snap the mouse to the horizontal center of the screen while maintaining the coordinate along the y-axis by using love.mouse.getY.

function love.keypressed( )
  love.mouse.setPosition( love.graphics.getWidth() * 0.5, love.mouse.getY() )
end

See Also


Other Languages