Skip to content

GetCursorPosition

Where the player’s cursor points, in the UI space.

The pointer’s place in the UI space (GetScreenSize: 1080 rows high, the width following the screen’s shape) while the cursor is up, the place OnMouseMove last told; nil while the cursor is down. For a hover check in OnFrame without keeping the place yourself.

GetCursorPosition()

number|nil, number|nil - x, y - the place in the UI space, or nil while the cursor is down

function OnFrame(dt)
local x, y = GetCursorPosition()
if x then SetUiPos("tooltip", x + 16, y + 16) end
end

OnMouseMove · IsCursorShown · the The game’s UI for a script group of the index