Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetMapIconData

From RoR Wiki
Revision as of 19:44, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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 the mapIcon field 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_markers01 texture.

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 )

See also