ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client events
  3. onClientCursorMove

Event

onClientCursorMove

ClientBrowserIdentical to MTA:SA

The cursor moved (only while it is visible; at most once per frame).

Handler

addEventHandler("onClientCursorMove", root, function(cursorX, cursorY, absoluteX, absoluteY, worldX, worldY, worldZ) ... end)

Parameters

cursorX, cursorYfloat
Relative position 0-1.
absoluteX, absoluteYfloat
Position in screen pixels.
worldX, worldY, worldZfloat
World point 300 m into the screen under the cursor.

Source

source is root.

Example

addEventHandler("onClientCursorMove", root, function(_, _, x, y)
    hovered = x > 100 and x < 300 and y > 100 and y < 140
end)

See also