WoW:API GetMacroIconInfo: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Added info for GetMacroIconInfo)
 
m (Move page script moved page API GetMacroIconInfo to API GetMacroIconInfo without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<center>'''GetMacroIconInfo'''</center>
{{wowapi}} __NOTOC__
 
Return information for a macro icon.
Return information for a macro icon.
iconTexture = GetMacroIconInfo(iconIndex)
==Parameters==
===Arguments===
:;iconIndex : Integer - The Index of the macro icon (from 1 to [[API_GetNumMacroIcons|GetNumMacroIcons()]]).
===Returns===
:;iconTexture : String - The path of the texture without extention


  Returns iconTexture = GetMacroIconInfo(index)
== Example ==
== Arguments ==
  local numIcons = GetNumMacroIcons();
:(index)
local iconTexture = GetMacroIconInfo(1);
 
DEFAULT_CHAT_FRAME:AddMessage(iconTexture);
:;Index: Numeric - The Index of the macro icon (not the data returned by GetMacroInfo).


== Returns ==
===Result===
 
Displays ''Interface\Icons\INV_Misc_QuestionMark'' in the default chat frame.
:;Texture
==Notes==
 
You need to call [[API_GetNumMacroIcons|GetNumMacroIcons()]] at least once before calling GetMacroIconInfo(), or the function will only return empty strings.
;''Texture''
:The path of the texture without extention
 
== Example ==
local Texture = GetMacroIconInfo(1)

Latest revision as of 04:46, 15 August 2023

WoW API < GetMacroIconInfo

Return information for a macro icon.

iconTexture = GetMacroIconInfo(iconIndex)

Parameters[edit]

Arguments[edit]

iconIndex
Integer - The Index of the macro icon (from 1 to GetNumMacroIcons()).

Returns[edit]

iconTexture
String - The path of the texture without extention

Example[edit]

local numIcons = GetNumMacroIcons();
local iconTexture = GetMacroIconInfo(1);
DEFAULT_CHAT_FRAME:AddMessage(iconTexture);

Result[edit]

Displays Interface\Icons\INV_Misc_QuestionMark in the default chat frame.

Notes[edit]

You need to call GetNumMacroIcons() at least once before calling GetMacroIconInfo(), or the function will only return empty strings.