event.y

Type Number
Event mouse
Revision 2017.3077
Keywords mouse, y

Overview

The mouse cursor's current y position on screen in content coordinates.

Example

-- Called when a mouse event has been received.
local function onMouseEvent( event )
    -- Print the mouse cursor's current position to the log.
    local message = "Mouse Position = (" .. tostring(event.x) .. "," .. tostring(event.y) .. ")"
    print( message )
end
                             
-- Add the mouse event listener.
Runtime:addEventListener( "mouse", onMouseEvent )