API:SetCursor
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Replaces the mouse cursor with an image built from a UI texture.
SetCursor(textureName)
Arguments
- textureName
string– Name of a texture known to the UI, such as the texture name returned byGetIconData.
Returns
Nothing.
Details
- The client looks the name up among the UI's registered textures, loads the image and builds a hardware cursor from it. The image
data/gamedata/cursor_corner.tgais loaded as well and passed along with it when the cursor is built. - If no texture with that name is registered, the cursor is left unchanged.
- The stock UI calls it when an icon is picked up and restores the normal cursor with
ClearCursor.
Errors
None besides the Invalid Parameters argument check.
Example
From ea_cursor/source/cursor.lua:
local texture, x, y = GetIconData( Cursor.Data.IconId ) SetCursor( texture ) SetItemDragging(true)
