<?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 — Mask on the map]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2135</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2135&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Mask on the map.]]></description>
		<lastBuildDate>Tue, 04 Jul 2023 08:11:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9102#p9102</link>
			<description><![CDATA[<p>I just want to tell you, thank you very much, just create an empty and assign the script you created and it works great!<br />Thanks a lot again!</p>]]></description>
			<author><![CDATA[null@example.com (andrea88.cristina)]]></author>
			<pubDate>Tue, 04 Jul 2023 08:11:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9102#p9102</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9101#p9101</link>
			<description><![CDATA[<p>Markers are not drawn through IMGUI or uGUI.<br />In the Draw to Texture mode, the markers are drawn on the texture.<br />In Tileset mode, the markers are separate meshes.</p><p>I reread your first post several times carefully, and realized that I missed an important thing in your question: that you&#039;re asking about all interaction with markers, not just tooltips.<br />To disable all interaction with markers outside the mask, you need to override the marker drawer.<br />If you are using Drawing to Texture mode, you need to override OnlineMapsMarkerBufferDrawer.<br />If you are using Tileset mode, you need to override OnlineMapsMarkerFlatDrawer.</p><p>Something like:<br /></p><div class="codebox"><pre><code>using UnityEngine;

namespace InfinityCode.OnlineMapsSupport
{
    public class MaskedMarkerDrawer: MonoBehaviour
    {
        public OnlineMaps map;
        public RectTransform mask;

        private void Start()
        {
            if (map == null) map = OnlineMaps.instance;
            map.control.markerDrawer = new Drawer(map.control, mask);
        }

        public class Drawer : OnlineMapsMarkerBufferDrawer
        {
            private RectTransform mask;

            public Drawer(OnlineMapsControlBase control, RectTransform mask) : base(control)
            {
                this.mask = mask;
            }

            private bool IsPositionMasked(Vector2 position)
            {
                return RectTransformUtility.RectangleContainsScreenPoint(mask, position);
            }

            public override OnlineMapsMarker GetMarkerFromScreen(Vector2 screenPosition)
            {
                if (!IsPositionMasked(screenPosition)) return null;
                return base.GetMarkerFromScreen(screenPosition);
            }
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 03 Jul 2023 20:27:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9101#p9101</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9100#p9100</link>
			<description><![CDATA[<p>Really thanks for the answare, but the problem is still there. </p><p>The main problem is that markers still have mouse events handled through IMGUI, since they are handled by the OnlineMapMarkerBase class, this means that when I hover over a marker, the mouse cursor is detected through the markerColliderRect , which I believe are always managed through IMGUI, and not UGUI. so this is not possible to disguise it, at least I think.<br />I also don&#039;t think markers are gameobjects, so you can&#039;t assign component buttons.</p>]]></description>
			<author><![CDATA[null@example.com (andrea88.cristina)]]></author>
			<pubDate>Mon, 03 Jul 2023 11:01:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9100#p9100</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9093#p9093</link>
			<description><![CDATA[<p>This way will force the map draw tooltips using uGUI instead of IMGUI (by default).<br />IMGUI is not maskable.<br />uGUI is maskable.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 27 Jun 2023 19:10:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9093#p9093</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9092#p9092</link>
			<description><![CDATA[<p>Could you explain to me why this could solve my problem? Are the elements drawn through IMGUI are maskable? Cause i really need to add a Button properties to all of this tooltips!</p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (andrea88.cristina)]]></author>
			<pubDate>Tue, 27 Jun 2023 09:05:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9092#p9092</guid>
		</item>
		<item>
			<title><![CDATA[Re: Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9091#p9091</link>
			<description><![CDATA[<p>Hi.</p><p>By default, tooltips are drawn with IMGUI, so this will be displayed on top of uGUI.<br />The best way in your case is to draw tooltips using uGUI.<br />Example:<br /><a href="https://infinity-code.com/atlas/online-maps/pages/uGUICustomTooltipForAllMarkersExample.html">https://infinity-code.com/atlas/online- … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 26 Jun 2023 19:33:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9091#p9091</guid>
		</item>
		<item>
			<title><![CDATA[Mask on the map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9090#p9090</link>
			<description><![CDATA[<p>Hi everyone!</p><p>I have created an interface google maps like, I have inserted my 2d map in a canvas, then later i created a mask and i applied it on it to make the interface a little more pleasant, the problem is that the markers i generated, don&#039;t they seem to be maskable, so I can always interact with the markers even when I&#039;m not with the pointer over the map,<br />Does anyone of you have an idea how to fix the problem and avoid interactions with markers when they are under the mask?</p><p><span class="postimg"><img src="https://forum.infinity-code.com/misc.php?action=pun_attachment&amp;item=1020&amp;preview&amp;secure_str=2614f29" alt="image" /></span></p>]]></description>
			<author><![CDATA[null@example.com (andrea88.cristina)]]></author>
			<pubDate>Mon, 26 Jun 2023 14:28:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9090#p9090</guid>
		</item>
	</channel>
</rss>
