Difference between revisions of "love.mouse.getX"
m (1 revision: Imported docs from potato.) |
(Add an example, see also) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | Returns the current x-position of the mouse. | |
− | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 10: | Line 9: | ||
=== Returns === | === Returns === | ||
{{param|number|x|The position of the mouse along the x-axis.}} | {{param|number|x|The position of the mouse along the x-axis.}} | ||
+ | == Examples == | ||
+ | Draw a vertical [[love.graphics.line|line]] at the mouse's x-position. | ||
+ | <source lang="lua"> | ||
+ | function love.draw() | ||
+ | local x = love.mouse.getX() | ||
+ | love.graphics.line(x,0, x,love.graphics.getHeight()) | ||
+ | end | ||
+ | </source> | ||
== See Also == | == See Also == | ||
* [[parent::love.mouse]] | * [[parent::love.mouse]] | ||
+ | * [[love.mouse.getY]] | ||
+ | * [[love.mouse.getPosition]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
− | {{#set:Description=}} | + | {{#set:Description=Returns the current x-position of the mouse.}} |
+ | {{#set:Since=000}} | ||
+ | == Other Languages == | ||
+ | {{i18n|love.mouse.getX}} |
Latest revision as of 13:48, 27 September 2011
Returns the current x-position of the mouse.
Function
Synopsis
x = love.mouse.getX( )
Arguments
None.
Returns
number x
- The position of the mouse along the x-axis.
Examples
Draw a vertical line at the mouse's x-position.
function love.draw()
local x = love.mouse.getX()
love.graphics.line(x,0, x,love.graphics.getHeight())
end
See Also
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