setCursorAlpha | Multi Theft Auto: Wiki Skip to content

setCursorAlpha

Client-side
Server-side
Shared

Pair: getCursorAlpha

This function is used to change alpha (transparency) of the client's cursor.

Visual representation of the cursor alpha:

Syntax

bool setCursorAlpha ( int alpha )
Required Arguments
  • alpha: The alpha value to set. Value can be in between 0 and 255, where 255 is fully opaque and 0 is fully transparent.

Returns

  • bool: result

Returns true if the new alpha value was set, or false otherwise.

Code Examples

client

This example sets the cursor alpha to 100 using /cursoralpha command:

addCommandHandler( "cursoralpha",
function ()
-- Show the cursor if it is not showing or hide the cursor if it is
showCursor( not isCursorShowing ( ) )
-- Set the alpha to 100
setCursorAlpha(100)
end
)