<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Setting marker color at runtime?]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1684&amp;type=atom" />
	<updated>2021-07-01T11:45:43Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1684</id>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker color at runtime?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7559#p7559" />
			<content type="html"><![CDATA[<p>You are right. Was user&#039;s fault.... <br />I created random colors between 0f and 255f but it should be between 0f and 1f.<br />Sorry and thanks!</p>]]></content>
			<author>
				<name><![CDATA[DDQ]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1662</uri>
			</author>
			<updated>2021-07-01T11:45:43Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7559#p7559</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker color at runtime?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7554#p7554" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Yes, this is the correct way and it works on my side (just checked).</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-06-28T22:31:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7554#p7554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker color at runtime?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7552#p7552" />
			<content type="html"><![CDATA[<p>Hi!</p><p>I want to plot points on a map and color them depending on a specific value. </p><p>Here is my code:</p><div class="codebox"><pre><code>        foreach (KeyValuePair&lt;int, Data&gt; p  in Dataset)
        {
            OnlineMapsMarker3D newMarker = MarkerController.Create(p.Value.Longitude, p.Value.Latitude, Marker_Dot);
            newMarker.scale = 6f;
            newMarker.transform.gameObject.GetComponent&lt;MeshRenderer&gt;().material.SetColor(&quot;_Color&quot;, Color_red);
        }</code></pre></div><p>Is this the correct approach? Because the markers are not red but white. If I select one of them and check the material, the diffuse color is white. If I click on the color and the color picker opens, I can see that actually the correct color is selected here. If I pick the color from the picker and close it, the color is displayed correctly. So I assumed that you maybe need to call something on the map component to update the markers?</p><p>Thanks for your help!<br />Danish</p>]]></content>
			<author>
				<name><![CDATA[DDQ]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1662</uri>
			</author>
			<updated>2021-06-28T15:26:29Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7552#p7552</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker color at runtime?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7118#p7118" />
			<content type="html"><![CDATA[<p>Hello.</p><p>The best way is to use 3D markers (which look like 2D markers) or UI markers.<br />In this case, you can change marker color directly in renderer or UI Image / RawImage.</p><p>For 2D markers, unfortunately you can only set a new texture like in your link.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-01-29T05:38:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7118#p7118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Setting marker color at runtime?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7115#p7115" />
			<content type="html"><![CDATA[<p>Hello, </p><p>I have seen there is a way to &quot;get colors&quot; from OnlineMapsMarker. What are these colors about? More generally, is there an easy way to apply a color on marker textures (at creation? at runtime?), similarly to what can be done with UI ImageRaw and Image? If not, i could probably go with something like that. <a href="https://gamedev.stackexchange.com/questions/141158/how-can-i-efficiently-make-a-solid-texture2d">https://gamedev.stackexchange.com/quest … -texture2d</a></p><p>Context: I m working on a theme-able interface in a flat design approach, to allow many themes to be designed for many contents of different origins. So for the UI side, i m using greyscale sprites, and just apply a color on top of them, and the result is fine. Would be great if i could extend this approach to onlineMaps markers.</p><p>Thanks.</p>]]></content>
			<author>
				<name><![CDATA[emmanuel.g.blanchard]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=109</uri>
			</author>
			<updated>2021-01-29T00:56:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7115#p7115</id>
		</entry>
</feed>
