Retrieves textures and colors for the parts of the alternate power indicator. Retrieves information on how to render the alternate power indicator. Note that the color can be 1,1,1,1 even if the bar appears to be colored because the color is baked into the texture.


See also Unit functions.

Signature:

texture, r, g, b, a = UnitAlternatePowerTextureInfo("unit", textureIndex)

Arguments:

  • unit - A unit to query (string, unitID)
  • textureIndex - (0-5) 1 for the background texture or 2 for the status bar texture (number)

Returns:

  • texture - file name for the requested texture, pass to SetTexture (string)
  • r - red color component, pass to SetVertexColor (number)
  • g - green color component, pass to SetVertexColor (number)
  • b - blue color component, pass to SetVertexColor (number)
  • a - alpha color component, pass to SetAlpha (number)

Examples:

local i for i = 0,5,1 do print(i, UnitAlternatePowerTextureInfo("player", i)) end
--On the stone guardians in Mogushan Vaults, this outputs
0 INTERFACE\UNITPOWERBARALT\STONEGUARDAMETHYST_HORIZONTAL_FRAME.BLP 1 1 1 1
1 INTERFACE\UNITPOWERBARALT\STONEGUARD_HORIZONTAL_BGND.BLP 1 1 1 1
2 INTERFACE\UNITPOWERBARALT\STONEGUARDAMETHYST_HORIZONTAL_FILL.BLP 1 1 1 1
3 nil 1 1 1 1
4 INTERFACE\UNITPOWERBARALT\STONEGUARD_HORIZONTAL_FLASH.BLP 1 1 1 1
5 nil 1 1 1 1