Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetIconData

From RoR Wiki

UI Lua API · Interface functions
Version: WAR 1.4.8

Returns the texture and texture coordinates for an icon id.

texture, x, y, disabledTexture = GetIconData(iconId)

Arguments

iconId
number – Icon id, as found in fields such as iconNum of ability, item and buff data.

Returns

texture
string – Name of the texture that holds the icon.
x, y
number – Position of the icon inside that texture.
disabledTexture
string – Name of a texture with the disabled (greyed) version of the icon, or an empty string if there is none.

Details

  • The id is converted to an integer.
  • If the id is not in the client's icon table, the data of the client's default icon entry is returned instead. There is no error for an unknown id.
  • All four values are returned on every successful call.
  • texture and disabledTexture are plain strings, not wide strings. easystem_utils/source/iconbuttonutils.lua compares disabledTexture with L""; ea_actionbars/source/actionbutton.lua compares it with "".

Errors

None.

Example

From easystem_utils/source/iconbuttonutils.lua:

local texture, x, y, disabledTexture = GetIconData( iconId )

-- Set the Normal Texture
DynamicImageSetTexture( iconButtonName.."Icon", texture, x, y )

From ea_actionbars/source/actionbutton.lua:

texture, x, y, disabledTexture = GetIconData (iconNum)

if (iconType == USE_DISABLED_ICON)
then
    if (disabledTexture ~= "")
    then
        texture = disabledTexture
    ...

See also