API:GetMapIconData
From RoR Wiki
UI Lua API · Interface functions
Version: WAR 1.4.8
Returns the texture coordinates and size of a map icon.
x, y, width, height = GetMapIconData(mapIconId)
Arguments
- mapIconId
number– Map icon id, for example themapIconfield of map point data.
Returns
- x, y
number– Position of the icon in the map marker texture.- width, height
number– Size of the icon.
Details
- The id is converted to an integer and looked up in the client's map icon table.
- If the id is not in the table, an error message is logged and the function returns
0, 0, 0, 0. - The stock UI uses the values with the
map_markers01texture.
Errors
Error in function call 'GetMapIconData': Map Icon id is invalid - %d
Example
From easystem_tooltips/source/maptooltips.lua:
textureX, textureY, sizeX, sizeY = GetMapIconData( ptData.mapIcon ) -- Clear the slice on the dynamic image. DynamicImageSetTexture will not work -- correctly if a slice is assigned. DynamicImageSetTextureSlice( iconWindow, "" ) DynamicImageSetTexture( iconWindow, "map_markers01", textureX, textureY ) ... DynamicImageSetTextureDimensions( iconWindow, sizeX, sizeY )
