<?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 — Map Input only when Mouse over Map]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1802</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1802&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Map Input only when Mouse over Map.]]></description>
		<lastBuildDate>Wed, 14 Jul 2021 16:57:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7596#p7596</link>
			<description><![CDATA[<p>Something like this (OnlineMapsRawImageTouchForwarder.OnGetTouchCount):<br /></p><div class="codebox"><pre><code>    private int OnGetTouchCount()
    {
        if (target != image.gameObject) return 0;

        int button = 1;
        Vector2 screenPosition = map.control.GetInputPosition();
        IOnlineMapsInteractiveElement interactiveElement = map.control.GetInteractiveElement(screenPosition);
        if (interactiveElement != null)
        {
            button = 0;
        }

#if UNITY_EDITOR
        return Input.GetMouseButton(button) ? 1 : 0;
#else
        if (Input.touchSupported)
        {
            if (Input.touchCount &gt; 0) return Input.touchCount;
        }
        return Input.GetMouseButton(button) ? 1 : 0;
#endif
    }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Jul 2021 16:57:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7596#p7596</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7591#p7591</link>
			<description><![CDATA[<p>Thank you very much for the video. Yes, this is exactly what I mean.</p><p>If you set &quot;return Input.GetMouseButton(1) ? 1 : 0;&quot;<br />-&gt; Map dragging: Right Mouse<br />-&gt; Marker OnPress event: Right Mouse</p><p>If you set &quot;return Input.GetMouseButton(0) ? 1 : 0;&quot;<br />-&gt; Map dragging: Left Mouse<br />-&gt; Marker OnPress event: Left Mouse</p><p>What I want:<br />-&gt; Map dragging: Right Mouse<br />-&gt; Marker OnPress event: Left Mouse</p><p>Those are the only events I think I can use:<br />OnClick<br />OnDoubleClick<br />OnPress<br />OnLongClick</p><p>What I would need:<br />OnClickRight</p><p>I just thought maybe I am missing something. Since your scripts are intertangled with each other heavily - plus, I can not easily raycast the markers through the raw image -, I just thought I ask before trying to change the scripts by myself.</p>]]></description>
			<author><![CDATA[null@example.com (DDQ)]]></author>
			<pubDate>Wed, 14 Jul 2021 11:57:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7591#p7591</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7585#p7585</link>
			<description><![CDATA[<p>Unfortunately I didn&#039;t understand your problem.<br />When you intercept OnGetTouchCount it automatically works for map and markers.<br />Here&#039;s a short video about it:<br /><a href="https://www.dropbox.com/s/qm5fl69sjw6qfa1/Markers%20-%20On%20Click%20Right%20Button%20.mp4?dl=0">https://www.dropbox.com/s/qm5fl69sjw6qf … 0.mp4?dl=0</a><br />Left-clicking - red circle, right-clicking - blue circle.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 12 Jul 2021 23:55:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7585#p7585</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7583#p7583</link>
			<description><![CDATA[<p>Thanks, this worked perfectly. Now, I can drag the map with the right mouse button to avoid faulty user input. This is because I want to have some UI functions, where you need to hold left mouse and move the cursor around to &quot;paint&quot; on the map. So, to unify user control, I also want clicking on markers to be still triggered by left mouse.</p><p>Unfortunately, when changing the button for dragging the map to right mosue, clicking on markers suddenly also only works with right click and not left click anymore. I looked into it and understand why that is (OnlineMapsControlbase / OnMapRelease). What would be the best approach to change this. I kind of understand what is going on but it&#039;s too much code to really make that decision.</p>]]></description>
			<author><![CDATA[null@example.com (DDQ)]]></author>
			<pubDate>Mon, 12 Jul 2021 10:25:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7583#p7583</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7574#p7574</link>
			<description><![CDATA[<p>Yes, you are thinking in the right direction.<br />This must be done using OnGetTouchCount and GetMouseButton(1).</p><p>GetMouseButton also is present in #else.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 07 Jul 2021 15:22:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7574#p7574</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7572#p7572</link>
			<description><![CDATA[<p>Thanks, sent you a mail!</p><p>Quick follow-up question:<br />I want to change drag control from Mouse 0 to Mouse 1 to keep Mouse 0 free for other tasks such as selection of elements on the map. How would I modify the code for that?</p><p>Am I right that this is only possible by modifying the code at OnlineMapsTouchForwarder in OnGetTouchCount() from GetMouseButton(0) to GetMouseButton(1)? Because this part of the code is embedded in #if UNITY_EDITOR markers. I also found GetTouchCount() in OnlineMapsControlBase. Is this the standalone counterpart?</p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (DDQ)]]></author>
			<pubDate>Wed, 07 Jul 2021 12:31:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7572#p7572</guid>
		</item>
		<item>
			<title><![CDATA[Re: Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7565#p7565</link>
			<description><![CDATA[<p>Hello.</p><p>As far as I understand you are using Raw Image Touch Forwarder, right?!<br />If so, this behavior has already been fixed.<br />Email me (support@infinity-code.com) and I will send you a modified script.</p><p>If not, please explain in detail the structure of your application (I am interested in how and where the map is used).<br />Quite possibly, a small video will help a lot here.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 01 Jul 2021 17:32:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7565#p7565</guid>
		</item>
		<item>
			<title><![CDATA[Map Input only when Mouse over Map]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7560#p7560</link>
			<description><![CDATA[<p>Hi there,</p><p>is there a built-in way to limit user control over the map to when the cursor is actually over the map? I am sure I can program this myself but I thought maybe it&#039;s already there somewhere hidden.</p><p>I am using the GUI setup with &quot;Map Image&quot; where a Map Render Texture is drawn. The Map Image is positioned on the screen such as a draggable window in Windows. I can move/scroll the map even if the mouse cursor is outside of this window area.</p><p>Thanks for your help!</p>]]></description>
			<author><![CDATA[null@example.com (DDQ)]]></author>
			<pubDate>Thu, 01 Jul 2021 11:51:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7560#p7560</guid>
		</item>
	</channel>
</rss>
