<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — How to make tooltip always display on screen and follow marker]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=496</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=496&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to make tooltip always display on screen and follow marker.]]></description>
		<lastBuildDate>Thu, 20 Apr 2017 09:26:11 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2255#p2255</link>
			<description><![CDATA[<p>Thanks for the script. Now this is much clearer to me.</p><p>1. In this case, using OnDrawTooltip is very expensive. <br />This action will be called every frame, for each visible marker.<br />Subscribe to OnlineMaps.OnMapUpdated, and update the tooltips only when the map is updated.<br />Something like:<br /></p><div class="codebox"><pre><code>private void Start() {
...
    map.OnMapUpdated += OnMapUpdated;
...
}

private void OnMapUpdated()
{
   foreach (OnlineMapsMarker marker in map.markers) DrawToolTipForMarker(marker);
}

private void DrawToolTipForMarker(OnlineMapsMarker marker)
{
    TooltipData tdata = marker.customData as TooltipData;
    if (marker.inMapView)
    {
        if (tdata == null)
        {
            // Create tooltip
        }
        // Update tooltip
    }
    else if (tdata != null)
    {
        // Destroy tooltip
    }
}

public class TooltipData 
{
    public GameObject instance;
    public UIWidget widget;
    ...
    // Any other data you need
}</code></pre></div><p>2. You can store all the tooltip data in marker.customData.<br />3. If the marker is not on the screen, you need to destroy the tooltip.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 20 Apr 2017 09:26:11 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2255#p2255</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2253#p2253</link>
			<description><![CDATA[<p>Yeah but I used the OnUpdateLate() only. This is my script:</p>]]></description>
			<author><![CDATA[null@example.com (anhdung.bka317)]]></author>
			<pubDate>Thu, 20 Apr 2017 03:29:17 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2253#p2253</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2250#p2250</link>
			<description><![CDATA[<p>You wrote that draw tooltips using NGUI, right?!<br />If so, you need to modify NGUICustomTooltipExample.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 19 Apr 2017 20:03:27 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2250#p2250</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2248#p2248</link>
			<description><![CDATA[<p>You mean modify OnlineMapsMarkerBase?</p>]]></description>
			<author><![CDATA[null@example.com (anhdung.bka317)]]></author>
			<pubDate>Wed, 19 Apr 2017 07:43:03 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2248#p2248</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2246#p2246</link>
			<description><![CDATA[<p>If you draw tooltips using NGUI, you do not need to use OnMarkerDrawTooltip.<br />You need to modify this script a bit, so that it draws tooltips for all markers.<br />It&#039;s very easy. If you&#039;ll have problems with modifying the script, write to me, and I&#039;ll modify this script for you.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 18 Apr 2017 22:53:34 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2246#p2246</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2244#p2244</link>
			<description><![CDATA[<p>I&#039;m drawing it with nGUI.<br />I just afraid this action would affect my app&#039;s performance when it has many tooltips.<br />I expect that this action is called when I change position the map or I zoom.</p>]]></description>
			<author><![CDATA[null@example.com (anhdung.bka317)]]></author>
			<pubDate>Tue, 18 Apr 2017 03:35:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2244#p2244</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2233#p2233</link>
			<description><![CDATA[<p>This action is invoked for each visible marker for which you need to draw a tooltip.<br />Did you expect any other behavior for this action?</p><p>The built-in tooltips are drawn using the old GUI system.<br />If you want to draw this with uGUI, you can change this.<br />Examples:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/uGUICustomTooltipForAllMarkersExample.html">http://infinity-code.com/atlas/online-m … ample.html</a><br /><a href="http://forum.infinity-code.com/viewtopic.php?pid=1615#p1615">http://forum.infinity-code.com/viewtopi … 1615#p1615</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 14 Apr 2017 13:50:08 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2233#p2233</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2228#p2228</link>
			<description><![CDATA[<p>Thanks for your help,<br />But I have one more question.<br />I used OnDrawTooltip() and it have been called a lot of times.<br />I afraid that it could affect performance.<br />Do you have any solution to call draw tooltip when I change position of map or change zoom?</p>]]></description>
			<author><![CDATA[null@example.com (anhdung.bka317)]]></author>
			<pubDate>Fri, 14 Apr 2017 04:40:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2228#p2228</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2177#p2177</link>
			<description><![CDATA[<p>Hello.</p><p>To always show tooltips use «Online Maps / Advanced / Show Marker Tooltip - Always».<br />To change the location of the tooltips, use OnlineMapsMarkerBase.OnMarkerDrawTooltip.<br />Example:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/OnDrawTooltipExample.html">http://infinity-code.com/atlas/online-m … ample.html</a><br />Using this action, you can make almost any behavior of tooltips.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 12 Apr 2017 11:39:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2177#p2177</guid>
		</item>
		<item>
			<title><![CDATA[How to make tooltip always display on screen and follow marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2172#p2172</link>
			<description><![CDATA[<p>Hi,<br />I am trying to make some tooltips and I want them to always display when I create them.<br />And I want them to follow their marker when I move the map.<br />I make it with NGUI<br />Is possible to do that?<br />Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (anhdung.bka317)]]></author>
			<pubDate>Tue, 11 Apr 2017 15:37:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2172#p2172</guid>
		</item>
	</channel>
</rss>
