Difference between revisions of "love.mouse.setPosition"

(Add an example, see also)
Line 1: Line 1:
Sets the current position of the mouse.
+
마우스의 위치를 설정합니다.
== Function ==
+
== 함수 ==
=== Synopsis ===
+
=== 형식 ===
 
<source lang="lua">
 
<source lang="lua">
 
love.mouse.setPosition( x, y )
 
love.mouse.setPosition( x, y )
 
</source>
 
</source>
=== Arguments ===
+
=== 매개변수 ===
{{param|number|x|The new position of the mouse along the x-axis.}}
+
{{param|number (한국어)|x|마우스의 x좌표.}}
{{param|number|y|The new position of the mouse along the y-axis.}}
+
{{param|number (한국어)|y|마우스의 y좌표.}}
=== Returns ===
+
=== 리턴값 ===
Nothing.
+
없음.
== Examples ==
+
== 다른 언어 ==
Snap the mouse to a new X position when the user presses a number key. The Y position is unchanged thanks to [[love.mouse.getY]].
+
* [[parent::love.mouse (한국어)]]
<source lang="lua">
+
* [[love.mouse.getPosition (한국어)]]
function love.keypressed(key)
+
* [[love.mouse.getX (한국어)]]
  if tonumber(key) then  -- if the key is numeric (0-9), execute the next line
+
* [[love.mouse.getY (한국어)]]
  love.mouse.setPosition(tonumber(key) * 10,  love.mouse.getY())  -- multiply the key by 10 to make the effect more visible, maintain the Y position via getY
 
  end
 
end
 
</source>
 
== See Also ==
 
* [[parent::love.mouse]]
 
* [[love.mouse.getPosition]]
 
* [[love.mouse.getX]]
 
* [[love.mouse.getY]]
 
 
[[Category:Functions]]
 
[[Category:Functions]]
{{#set:Description=Sets the current position of the mouse.}}
+
{{#set:Description=마우스의 위치를 설정합니다.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
== Other Languages ==
+
== 다른 언어 ==
 
{{i18n|love.mouse.setPosition}}
 
{{i18n|love.mouse.setPosition}}

Revision as of 11:44, 20 January 2014

마우스의 위치를 설정합니다.

함수

형식

love.mouse.setPosition( x, y )

매개변수

number (한국어) x
마우스의 x좌표.
number (한국어) y
마우스의 y좌표.

리턴값

없음.

다른 언어


다른 언어