<?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 update a DrawingElement]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=454</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=454&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to update a DrawingElement.]]></description>
		<lastBuildDate>Thu, 30 Mar 2017 12:15:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2126#p2126</link>
			<description><![CDATA[<p>We replaced fields to properties, and now Redraw is invoked automatically.</p><p>Redraw just marks that map must be redrawed. <br />Drawing occurs a little bit later and once (no matter how many times you invoke Redraw).</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 30 Mar 2017 12:15:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2126#p2126</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2123#p2123</link>
			<description><![CDATA[<p>Okay gotcha. Didn&#039;t realize we would have to explicitly call OnlineMaps.instance.Redraw(). That works. </p><p>I see there is an OnlineMaps.instance.needRedraw. Maybe this could be set in a color property when the color is set. I am assuming the &quot;needRedraw&quot; flag will tell the map to redraw at some point, but will only happen when it gets to that point? So a lot of color changes could happen, and only one redraw would have to happen?</p>]]></description>
			<author><![CDATA[null@example.com (bp10719)]]></author>
			<pubDate>Wed, 29 Mar 2017 16:38:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2123#p2123</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2116#p2116</link>
			<description><![CDATA[<p>Hello.</p><p>Test script (works well on my side):<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class TestRectBackground:MonoBehaviour
{
    private OnlineMapsDrawingRect rect;

    private void OnGUI()
    {
        if (GUILayout.Button(&quot;Randomize background color&quot;))
        {
            rect.backgroundColor = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
            OnlineMaps.instance.Redraw();
        }
        if (GUILayout.Button(&quot;Randomize border color&quot;))
        {
            rect.borderColor = new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
            OnlineMaps.instance.Redraw();
        }
    }

    private void Start()
    {
        rect = new OnlineMapsDrawingRect(0, 0, 1, 1, Color.black, 3, Color.red);
        OnlineMaps.instance.AddDrawingElement(rect);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 28 Mar 2017 22:25:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2116#p2116</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2115#p2115</link>
			<description><![CDATA[<p>Hi there,</p><p>We have updated to the newest version, but this issue persists. The DrawingRect&#039;s color does not get changed immediately after setting it. It appears some kind of event has to occur before OnlineMaps will update or something like that. If we set the background color of a DrawingRect for example, we won&#039;t see it change until the map is clicked. For now, to get past this, when we update the color we do:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.RemoveDrawingElement(drawingRect, false);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.AddDrawingElement(drawingRect);</p>]]></description>
			<author><![CDATA[null@example.com (bp10719)]]></author>
			<pubDate>Tue, 28 Mar 2017 22:19:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2115#p2115</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1957#p1957</link>
			<description><![CDATA[<p>Gotcha. Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (bp10719)]]></author>
			<pubDate>Thu, 09 Mar 2017 22:55:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1957#p1957</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1956#p1956</link>
			<description><![CDATA[<p>Hello.</p><p>This is a bug in Online Maps.<br />Fixed. In the next version this will work correctly.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 09 Mar 2017 22:51:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1956#p1956</guid>
		</item>
		<item>
			<title><![CDATA[How to update a DrawingElement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1955#p1955</link>
			<description><![CDATA[<p>I am trying to figure out how to update a drawing element after it is created.</p><p>I can create a drawingElement and save a reference to it, and update its properties, but the changes are not displayed on the map after it is initially added.</p><p>Is there any way to update a drawing element that has been added to the map after it is created? And be able to show those changes?</p><p>For example, I want to change the background color of an OnlineMapsDrawingRect. </p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (bp10719)]]></author>
			<pubDate>Thu, 09 Mar 2017 22:39:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1955#p1955</guid>
		</item>
	</channel>
</rss>
