|
|
Function
love.mouse.getY( )
Gets the current y-position of the mouse. Use this if you for some reason
only need the position along the y-axis. Otherwise, you probably want to use love.mouse.getPosition.
Synopsis
y = love.mouse.getY( )
Arguments
(None)
Returns
number
Current y-position.
See Also
Examples
Example 3: Getting the x- and y-position of the mouse
function load() local f = love.graphics.newFont(love.default_font, 14) love.graphics.setFont(f) end function draw() -- Gets the x- and y-position of the mouse. local x = love.mouse.getX() local y = love.mouse.getY() -- Draws the position on screen. love.graphics.draw("The mouse is at (" .. x .. "," .. y .. ")", 50, 50) end
Copyright © 2006-2008 LÖVE Development Team.
|