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

Function

setCursorPosition

ClientMiscellaneousIdentical to MTA:SA

Moves the cursor to a spot in the game window (pixels). Returns false when the game window is not active or is minimised.

Syntax

bool setCursorPosition(int cursorX, int cursorY)

Arguments

cursorXint
X in pixels.
cursorYint
Y in pixels.

Returns

true on success.

Example

local sw, sh = guiGetScreenSize()
showCursor(true)
setCursorPosition(sw / 2, sh / 2)

See also