- Documentation
- Client functions
- setCursorType
Function
setCursorType
Changes the game cursor shape. Without an argument the cursor goes back to changing shape by itself: over a link in a browser it turns into a hand, over a text field into an I-beam.
Syntax
bool setCursorType([string name = nil])Arguments
namestring, optional = nil"arrow","hand","text","crosshair","move","wait","progress","help","no","sizewe","sizens","sizenesw","sizenwse"or"none"(cursor hidden, controls still blocked).
Returns
true on success, false for an unknown name.
Example
addEventHandler("onClientGUIMouseDown", root, function()
setCursorType("move")
end)
addEventHandler("onClientGUIMouseUp", root, function()
setCursorType()
end)
See also
getCursorTypeReturns the current cursor shape: the name set withsetCursorType, or the shape the cursor took by itself over a browser.setCursorAlphaSets the in-game cursor alpha (0 = invisible, 255 = opaque). The cursor shown withshowCursoris drawn by the game, above the HUD, GUI and browsers, so the alpha also shows on screenshots.showCursorShows or hides the mouse cursor. The cursor stays visible while at least one resource wants it, so hiding it in one resource does not close another's cursor. By default, while the cursor is shown, the ped controls are blocked.