<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — NGUI Rotate the camera on a compass]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=195&amp;type=atom" />
	<updated>2016-07-26T00:41:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=195</id>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=928#p928" />
			<content type="html"><![CDATA[<p>Thank you for quick response.</p><p>It works fine.</p>]]></content>
			<author>
				<name><![CDATA[mininox]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=187</uri>
			</author>
			<updated>2016-07-26T00:41:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=928#p928</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=921#p921" />
			<content type="html"><![CDATA[<p>Hello.</p><p>I can see on the video that you have problems with custom marker system for NGUI, right?<br />We fixed it. Now it will work correctly.<br />Please update Online Maps.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-25T19:56:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=921#p921</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=914#p914" />
			<content type="html"><![CDATA[<p>Hello.</p><p>private void OnCompassChanged(float compass)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;compass : &quot; + compass);<br />&nbsp; &nbsp; &nbsp; &nbsp; int angle = (int)(compass * 360);<br />&nbsp; &nbsp; &nbsp; &nbsp; this.MainUI.t_Compass.text = angle.ToString();<br />&nbsp; &nbsp; &nbsp; &nbsp; this.Map.transform.rotation = Quaternion.Euler(0, 0, angle);<br />&nbsp; &nbsp; }</p><p>The map will rotate well.</p><p>but When dragging a rotated map, marker is problem.</p><p>link : <a href="https://dl.dropboxusercontent.com/u/164464635/IMG_0581.m4v">https://dl.dropboxusercontent.com/u/164 … G_0581.m4v</a></p>]]></content>
			<author>
				<name><![CDATA[mininox]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=187</uri>
			</author>
			<updated>2016-07-25T08:48:34Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=914#p914</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=911#p911" />
			<content type="html"><![CDATA[<p>Hello.</p><p>What is «angle» in your script?<br />The parameter is called «f».</p><p>The code that I tested, and that works for NGUI:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class RotateNGUITextureByCompass : MonoBehaviour
{
    private void Start()
    {
        OnlineMapsLocationService.instance.OnCompassChanged += OnCompassChanged;
    }

    private void OnCompassChanged(float f)
    {
        transform.rotation = Quaternion.Euler(0, 0, f * 360);
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-25T07:50:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=911#p911</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=909#p909" />
			<content type="html"><![CDATA[<p>Answer Thank you</p><p>I was late for an answer.</p><p>How use?</p><p>my version v2.4.0.53.</p><p>I&#039;ve written to the code above</p><p>private void OnCompassChanged(float f)<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; this.transform.rotation = Quaternion.Euler(0,0,angle); //(UITexture GameObject)<br />}</p><p>There are still problems (Marker Position problems) when Drag.</p>]]></content>
			<author>
				<name><![CDATA[mininox]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=187</uri>
			</author>
			<updated>2016-07-25T05:34:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=909#p909</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=898#p898" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Update is now available.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-22T10:55:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=898#p898</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=894#p894" />
			<content type="html"><![CDATA[<p>Thank you. Answer.</p><p>I look forward to solutions.</p>]]></content>
			<author>
				<name><![CDATA[mininox]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=187</uri>
			</author>
			<updated>2016-07-22T05:34:17Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=894#p894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=889#p889" />
			<content type="html"><![CDATA[<p>That&#039;s funny.<br />I wrote previous post and immediately found a way how to do it.<br />Within 24 hours we will release update (through the built-in update system), which will support the rotation of NGUI map.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-21T13:26:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=889#p889</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=888#p888" />
			<content type="html"><![CDATA[<p>Hello.</p><p>This example is created for Tileset.<br />NGUI control does not support rotation of map.<br />If you want to rotate the camera / map, use Tileset control.</p><p>At the moment I have no idea how to convert the screen coordinate to relative point of rotated widget.<br />I&#039;ll try to ask NGUI creators. If they give me some advice, we will add this feature.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-07-21T12:15:33Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=888#p888</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[NGUI Rotate the camera on a compass]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=877#p877" />
			<content type="html"><![CDATA[<p>Hello</p><p>using UnityEngine;</p><p>namespace InfinityCode.OnlineMapsExamples<br />{<br />&nbsp; &nbsp; [AddComponentMenu(&quot;Infinity Code/Online Maps/Examples (API Usage)/RoteteCameraByGPSExample&quot;)]<br />&nbsp; &nbsp; public class RoteteCameraByGPSExample : MonoBehaviour<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; private void Start()<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsLocationService.instance.OnCompassChanged += OnCompassChanged;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; private void OnCompassChanged(float f)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsTileSetControl.instance.cameraRotation.y = f * 360;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p><p>NGUI Only Texture. The above source does not operate.</p><p>&nbsp; &nbsp; &nbsp; &nbsp; private void OnCompassChanged(float f)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.transform.rotation = Quaternion.Euler(0,0,angle); //(UITexture GameObject)<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>The above source, rotate well. But there is a problem with touch and drag the marker.</p><p>Please NGUI Rotate the camera on a compass.</p><p>I&#039;m sorry that I can not speak English.</p><p>Thank you.</p>]]></content>
			<author>
				<name><![CDATA[mininox]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=187</uri>
			</author>
			<updated>2016-07-21T05:17:43Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=877#p877</id>
		</entry>
</feed>
