Spec-Zone.ru › LÖVE

love.mouse.getX

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

  • love.mouse
  • love.mouse.getY
  • love.mouse.getPosition


© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.mouse.getX

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API