<?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 — Smooth zoom and 2D markers scaling]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=389</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=389&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Smooth zoom and 2D markers scaling.]]></description>
		<lastBuildDate>Thu, 19 Jan 2017 13:57:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Smooth zoom and 2D markers scaling]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1694#p1694</link>
			<description><![CDATA[<p>Ok, it works. Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Thu, 19 Jan 2017 13:57:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1694#p1694</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth zoom and 2D markers scaling]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1692#p1692</link>
			<description><![CDATA[<p>Hello.</p><p>Something like:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class ScaleMarkerOnZoom:MonoBehaviour
{
    private OnlineMaps map;
    private OnlineMapsTileSetControl control;

    private void Start()
    {
        map = OnlineMaps.instance;
        control = OnlineMapsTileSetControl.instance;
        control.OnMapClick += OnMapClick;
        control.OnSmoothZoomProcess += UpdateMarkerScale;
        control.OnSmoothZoomFinish += UpdateMarkerScale;
    }

    private void OnMapClick()
    {
        map.AddMarker(control.GetCoords());
        UpdateMarkerScale();
    }

    private void UpdateMarkerScale()
    {
        float scale = map.transform.localScale.x;
        float size = Mathf.Pow(2, -Mathf.Log(scale, 2));

        foreach (OnlineMapsMarker marker in OnlineMaps.instance.markers) marker.scale = size;
        map.Redraw();
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 19 Jan 2017 00:55:23 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1692#p1692</guid>
		</item>
		<item>
			<title><![CDATA[Smooth zoom and 2D markers scaling]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1691#p1691</link>
			<description><![CDATA[<p>Hello,<br />is it possible to avoid the markers scaling during the map zoom, with smooth zoom enabled?</p><p>I would like to show markers without any resizing during zoom operations on the map.</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Wed, 18 Jan 2017 10:12:11 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1691#p1691</guid>
		</item>
	</channel>
</rss>
