love.mouse.getGlobalPosition

Available since LÖVE 12.0
This function is not supported in earlier versions.

Gets the global position of the mouse on the screen. This can be used when implementing custom drag areas in the window.

The global mouse position is in the same coordinate space as love.window.getPosition and love.window.setPosition.

Function

Synopsis

x, y, displayindex = love.mouse.getGlobalPosition( )

Arguments

None.

Returns

number x
The x-coordinate of the mouse's global position, within its current display.
number y
The y-coordinate of the mouse's global position, within its current display.
number displayindex
The index of the display that the mouse is in.

See Also

Other Languages