ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getCursorPositionAbsolute

Function

getCursorPositionAbsolute

ClientMiscellaneousTrilogy Hub only

Returns the cursor position in screen pixels (while the cursor is shown).

Syntax

float, float getCursorPositionAbsolute()

Returns

x and y in pixels or false.

Example

addEventHandler("onClientRender", root, function()
    local x, y = getCursorPositionAbsolute()
    if x then dxDrawRectangle(x - 2, y - 2, 4, 4, tocolor(255, 122, 34)) end
end)

See also