WoW:API SetCursor: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Note new (1.11) possibility to pass path to graphic. Note that it is uncertain how it can be used.)
m (Move page script moved page API SetCursor to API SetCursor without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{wowapi}}
{{wowapi}}
Changes the current cursor graphic.
changed = SetCursor(cursor);


SetCursor(cursor);
==Arguments==
;cursor: String - one of the following graphic descriptors:
:* Path to a cursor graphic.
:* "xx.blp", where xx is a filename in the Interface\CURSORS folder. For example, if you are trying to set the cursor to taxi.blp: SetCursor("taxi.blp"). You can also use a capitalized version of the filename: SetCursor("TAXI.BLP").
:* Non-existent path; cursor is hidden.
:* nil; cursor is reset to default.


== Parameters ==
== Returns ==
 
;changed : 1 if cursor graphic is changed, nil otherwise.
=== Arguments ===
 
;cursor: String - Can be one of these:
:* "ATTACK_CURSOR"
:* "ATTACK_ERROR_CURSOR"
:* "BUY_CURSOR"
:* "BUY_ERROR_CURSOR"
:* "CAST_CURSOR"
:* "CAST_ERROR_CURSOR"
:* "POINT_CURSOR"
:* "POINT_ERROR_CURSOR"
 
:* nil - resets cursor
 
:* A path to a 32x32 cursor graphic  


NOTE: after 3.1, this returns true every time regardless of what the graphic was previously and what you tried to change it to.


== Details ==
== Details ==
* The option to pass ''nil'' was added in 1.11.
* The option to pass ''nil'' was added in 1.11.
 
* For custom textures: The graphic must be an UNCOMPRESSED BLP file; compressed BLP files will only work for software cursors.
* The option to pass a path to a bitmap was added in 1.11. It is yet unclear if it is possible to use graphics outside Blizzard's .mpq's.
* If the cursor is hovering over WorldFrame, the SetCursor function will have no effect - cursor is locked to reflect what the player is currently pointing at.

Latest revision as of 04:47, 15 August 2023

WoW API < SetCursor

Changes the current cursor graphic.

changed = SetCursor(cursor);

Arguments

cursor
String - one of the following graphic descriptors:
  • Path to a cursor graphic.
  • "xx.blp", where xx is a filename in the Interface\CURSORS folder. For example, if you are trying to set the cursor to taxi.blp: SetCursor("taxi.blp"). You can also use a capitalized version of the filename: SetCursor("TAXI.BLP").
  • Non-existent path; cursor is hidden.
  • nil; cursor is reset to default.

Returns

changed
1 if cursor graphic is changed, nil otherwise.

NOTE: after 3.1, this returns true every time regardless of what the graphic was previously and what you tried to change it to.

Details

  • The option to pass nil was added in 1.11.
  • For custom textures: The graphic must be an UNCOMPRESSED BLP file; compressed BLP files will only work for software cursors.
  • If the cursor is hovering over WorldFrame, the SetCursor function will have no effect - cursor is locked to reflect what the player is currently pointing at.