<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Setting marker texture causes alignment issues]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1412&amp;type=atom" />
	<updated>2020-01-13T09:19:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1412</id>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker texture causes alignment issues]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5860#p5860" />
			<content type="html"><![CDATA[<p>I tested both of your ways and still cannot reproduce the problem.<br />If possible, send a scene (as a package) that has a problem to me (support@infinity-code.com) for testing.</p><p>To make it clear:<br />I do not need your working project.<br />I need any scene where this problem is appears.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-01-13T09:19:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5860#p5860</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker texture causes alignment issues]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5857#p5857" />
			<content type="html"><![CDATA[<p>Sorry, I forgot to specify that this issue is encountered when adding the markers through code.</p><p>Here&#039;s an example</p><div class="codebox"><pre><code>zoomedInCenterMarker = new OnlineMapsMarker {
            align = OnlineMapsAlign.Center,
            range = new OnlineMapsRange(min: MapSetupUIHandler.Instance.cacheRegionEditZoomLevel, max: OnlineMaps.MAXZOOM),
            OnDrag = delegate (OnlineMapsMarkerBase marker) { OnCenterMarkerDragged(); },
            texture = MapSetupUIHandler.Instance.editCenterTexture
        };
        OnlineMapsMarkerManager.AddItem(zoomedInCenterMarker);</code></pre></div><p>Yields the top image in the attachment when combined with other markers which have had the texture set after AddItem has been called. You can see the center marker has been aligned such that the top left of the image is in the center, despite the code specifying that it should be centered.</p><div class="codebox"><pre><code>zoomedInCenterMarker = new OnlineMapsMarker {
            align = OnlineMapsAlign.Center,
            range = new OnlineMapsRange(min: MapSetupUIHandler.Instance.cacheRegionEditZoomLevel, max: OnlineMaps.MAXZOOM),
            OnDrag = delegate (OnlineMapsMarkerBase marker) { OnCenterMarkerDragged(); },
            //texture = MapSetupUIHandler.Instance.editCenterTexture
        };
        OnlineMapsMarkerManager.AddItem(zoomedInCenterMarker);
        zoomedInCenterMarker.texture = MapSetupUIHandler.Instance.editCenterTexture;</code></pre></div><p>When the texture is set after the issue is corrected, see the bottom image (no other code changes have occurred).</p>]]></content>
			<author>
				<name><![CDATA[Chootin]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1175</uri>
			</author>
			<updated>2020-01-13T07:10:55Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5857#p5857</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Setting marker texture causes alignment issues]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5832#p5832" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Thank you for the bug report.<br />Unfortunately, I could not reproduce the problem.<br />Video:<br /><a href="https://www.dropbox.com/s/lk72rj8xx0miwg1/ScreenRecorderProject34.mp4?dl=0">https://www.dropbox.com/s/lk72rj8xx0miw … 4.mp4?dl=0</a><br />I missed something?</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-10T09:42:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5832#p5832</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Setting marker texture causes alignment issues]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5828#p5828" />
			<content type="html"><![CDATA[<p>Setting the texture of a marker before it is added to a map causes that marker to always align to the top left corner, rather than the specified alignment.</p><p>The alignment works correctly if you add the marker to the map first, then update the texture.</p>]]></content>
			<author>
				<name><![CDATA[Chootin]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1175</uri>
			</author>
			<updated>2019-12-10T02:11:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5828#p5828</id>
		</entry>
</feed>
