API:SetHardwareCursor
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Switches the mouse pointer to one of the client's built-in cursor shapes.
SetHardwareCursor(cursorId)
Arguments
- cursorId
number– Cursor number, 0 to 21. Use theSystemData.Cursorvalues. Fractions are dropped.
Returns
Nothing.
Details
- The client loads the cursor image for that number from its own resources (some numbers are animated cursors) and makes it the Windows mouse pointer of the game window.
- 0 is the normal arrow.
- Numbers outside 0–21 are ignored without an error.
- If the pointer already has the requested number, the shape is not reloaded.
- 15 has no cursor image in the client: the pointer is set to no image.
- The stock UI uses it to show the resize cursor while a window is being resized; ClearCursor sets the arrow back.
- The function needs at least one argument and only reads the last one.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From WindowUtils.BeginResize in easystem_windowutils/source/windowutils.lua:
WindowUtils.resizeEndCallback = endCallback SetHardwareCursor(SystemData.Cursor.RESIZE2)
