WoW API: GetItemIcon
← WoW API < GetItemIcon
Return the icon texture for the item.
itemIcon = GetItemIcon(itemID or "itemString" or "itemName" or "itemLink")
Parameters
Arguments
- (itemId or "itemString" or "itemName" or "itemLink")
- itemId
- Integer - The numeric ID of the item. ie. 12345
- itemString
- String - The full item ID in string format, e.g. "item:12345:0:0:0:0:0:0:0".
- Also supports partial itemStrings, by filling up any missing ":x" value with ":0", e.g. "item:12345:0:0:0"
- itemName
- String - The Name of the Item, ex: "Hearthstone"
- The item must have been equiped, in your bags or in your bank once in this session for this to work.
Returns
- "itemIcon"
- itemIcon
- String - The name and path of the icon texture of the item.
Example
local itemIcon = GetItemIcon("item:6948") print("itemIcon :", itemIcon)
itemIcon = GetItemIcon("Hearthstone") print("itemIcon :", itemIcon)
itemIcon = GetItemIcon(6948) print("itemIcon :", itemIcon)
Result
- prints Hearthstone icon 3 times - "Interface\\Icons\\INV_Misc_Rune_01".
Common usage
local itemIcon = GetItemIcon(link)