love.mouse.getX

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


doc_love
2017-03-21 15:49:35
Comments
Leave a Comment

Please login to continue.