Skip to content

OnMouseMove

The player’s cursor moved.

The pointer’s new place in the UI space (GetScreenSize: 1080 rows high), at most once a frame while the cursor is up - the first place as the cursor comes up, then every move. For hover effects and drags in a menu of the script’s own; GetCursorPosition reads the same place at any moment.

function OnMouseMove(x, y)
-- ...
end
Parameter Type
x number the pointer’s place across, in the UI space
y number the pointer’s place down, in the UI space (0 at the top, 1080 at the bottom)

nothing

-- a button that lights up under the pointer
function OnMouseMove(x, y)
local over = x >= 100 and x <= 300 and y >= 900 and y <= 960
SetUiAlpha("door_btn", over and 100 or 70)
end

GetCursorPosition · OnMouseButton · OnCursorChange · the The game’s UI for a script group of the index