<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetMapTextPoints</id>
	<title>API:GetMapTextPoints - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3AGetMapTextPoints"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetMapTextPoints&amp;action=history"/>
	<updated>2026-10-19T18:02:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:GetMapTextPoints&amp;diff=30429&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:GetMapTextPoints&amp;diff=30429&amp;oldid=prev"/>
		<updated>2026-10-16T19:44:27Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Map}}&lt;br /&gt;
Returns the text labels (place names) to draw on the map currently shown in a map window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
points = GetMapTextPoints(mapDisplayName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;mapDisplayName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of a MapDisplay window set up with [[API:CreateMapInstance|CreateMapInstance]].&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;points : &amp;lt;code&amp;gt;table&amp;lt;/code&amp;gt; – Array of text points, indexed from 1. Nothing is returned if the window is not a known map window or its map has no text data.&lt;br /&gt;
&lt;br /&gt;
Each entry:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Type !! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Id of the label text. The stock UI looks it up with &amp;lt;code&amp;gt;GetStringFromTable(&amp;quot;MapTextPoints&amp;quot;, id)&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;font&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Font name; the stock UI passes it to &amp;lt;code&amp;gt;LabelSetFont&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;red&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;green&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;blue&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Text colour.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;align&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; || Alignment. The stock UI checks for &amp;lt;code&amp;gt;&amp;quot;center&amp;quot;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;quot;right&amp;quot;&amp;lt;/code&amp;gt; and treats anything else as left.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; || Map coordinates of the label. Convert them with [[API:MapGetPointForCoordinates|MapGetPointForCoordinates]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The data comes from the client&amp;#039;s map data for the map the window is showing.&lt;br /&gt;
* If the client&amp;#039;s map data is not loaded, the function returns nothing.&lt;br /&gt;
* Exactly one argument must be passed.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
None besides the generic &amp;#039;&amp;#039;Invalid Parameters&amp;#039;&amp;#039; message when the argument is missing or not a string.&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_worldmapwindow/source/zoneview.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local mapDisplay = &amp;quot;EA_Window_WorldMapZoneViewMapDisplay&amp;quot;&lt;br /&gt;
local textPointData = GetMapTextPoints( mapDisplay )&lt;br /&gt;
&lt;br /&gt;
for pointIndex, textPoint in ipairs(textPointData)&lt;br /&gt;
do&lt;br /&gt;
    local textPointWindow = &amp;quot;TextPoint_&amp;quot;..currentZoneId..&amp;quot;_&amp;quot;..pointIndex&lt;br /&gt;
    local x, y = MapGetPointForCoordinates(mapDisplay, textPoint.x, textPoint.y)&lt;br /&gt;
    ...&lt;br /&gt;
    CreateWindowFromTemplate(textPointWindow, &amp;quot;MapTextPoint&amp;quot;, mapDisplay)&lt;br /&gt;
    WindowAddAnchor(textPointWindow, &amp;quot;topleft&amp;quot;, mapDisplay, relPoint, x, y)&lt;br /&gt;
    LabelSetFont(textPointWindow, textPoint.font, WindowUtils.FONT_DEFAULT_TEXT_LINESPACING)&lt;br /&gt;
    LabelSetTextColor(textPointWindow, textPoint.red, textPoint.green, textPoint.blue)&lt;br /&gt;
    LabelSetTextAlign(textPointWindow, align)&lt;br /&gt;
    LabelSetText(textPointWindow, GetStringFromTable(&amp;quot;MapTextPoints&amp;quot;, textPoint.id))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:MapGetPointForCoordinates|MapGetPointForCoordinates]]&lt;br /&gt;
* [[API:GetZoneTransitionPoints|GetZoneTransitionPoints]]&lt;br /&gt;
* [[API:CreateMapInstance|CreateMapInstance]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>