<?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 rotate the map with one finger?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=712</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=712&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to rotate the map with one finger?.]]></description>
		<lastBuildDate>Tue, 28 Nov 2017 14:10:46 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to rotate the map with one finger?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3084#p3084</link>
			<description><![CDATA[<p>Thank you, Alex! I&#039;ll try your solution <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (YanaAzur)]]></author>
			<pubDate>Tue, 28 Nov 2017 14:10:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3084#p3084</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to rotate the map with one finger?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3083#p3083</link>
			<description><![CDATA[<p>Hello.</p><p>Yes, you have two ways:<br />1. Disable Allow Camera Control, and implement your own camera rotation around the map.</p><p>2. Something like this:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class RotateCameraUsingOneFinger:MonoBehaviour
{
    public Vector2 cameraSpeed = Vector2.one;

    private OnlineMapsTileSetControl control;
    private Vector2 lastGestureCenter;
    private bool hasRotation = false;

    private void Start()
    {
        control = OnlineMapsTileSetControl.instance;
        control.allowUserControl = false;
        control.cameraSpeed = Vector2.zero;
    }

    private void Update()
    {
        if (control.GetTouchCount() != 1)
        {
            if (hasRotation)
            {
                hasRotation = false;
                lastGestureCenter = Vector2.zero;
            }
            return;
        }

        hasRotation = true;
        Vector2 center = control.GetInputPosition();
        if (lastGestureCenter == Vector2.zero) lastGestureCenter = center;
        else if (lastGestureCenter != center)
        {
            Vector2 offset = lastGestureCenter - center;
            control.cameraRotation.x -= offset.y / 10f * cameraSpeed.x;
            control.cameraRotation.y -= offset.x / 10f * cameraSpeed.y;
            lastGestureCenter = center;
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 28 Nov 2017 14:05:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3083#p3083</guid>
		</item>
		<item>
			<title><![CDATA[How to rotate the map with one finger?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3081#p3081</link>
			<description><![CDATA[<p>By default user can pan the map with one finger, and zoom/rotate map with two-finger gesture. I have unchecked &quot;Allow User Control&quot; and &quot;Allow Zoom&quot; options on &quot;Online Maps Tile Set Control&quot; component. Now all user can do is to rotate the map with 2 fingers around current GPS location. Is it possible to change this allowing user rotate the map with single finger?</p>]]></description>
			<author><![CDATA[null@example.com (YanaAzur)]]></author>
			<pubDate>Tue, 28 Nov 2017 13:09:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3081#p3081</guid>
		</item>
	</channel>
</rss>
