<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Best way to adapt map to phones resolutions]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=570&amp;type=atom" />
	<updated>2017-07-04T21:33:51Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=570</id>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2577#p2577" />
			<content type="html"><![CDATA[<p>Thanks Alex, much appreciated!</p>]]></content>
			<author>
				<name><![CDATA[raptorx81]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=502</uri>
			</author>
			<updated>2017-07-04T21:33:51Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2577#p2577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2572#p2572" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Thank you for bug report.<br />The problem with SetTexture is fixed.<br />The new version will be available soon.</p><p>P.S.<br />Not correct:<br /></p><div class="codebox"><pre><code>Texture2D tex = new Texture2D(Screen.width, Screen.height);</code></pre></div><p>The size of the map should be N * 256.<br />The right way:<br /></p><div class="codebox"><pre><code>int w = Screen.width;
int h = Screen.height;
int ow = w % 256;
int oh = h % 256;
if (ow != 0) w += 256 - ow;
if (oh != 0) h += 256 - oh;
Texture2D texture = new Texture2D(w, h, TextureFormat.ARGB32, false);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-07-01T20:29:22Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2572#p2572</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2562#p2562" />
			<content type="html"><![CDATA[<p>Hi there, I&#039;m running into a strange issue. I&#039;m trying to make the map texture the same size as the screen, but I&#039;m getting tons of errors. This is my code :</p><p>Texture2D tex = new Texture2D(Screen.width, Screen.height);</p><p>OnlineMaps.instance.SetTexture(tex);</p><p>If I do that, I get a whole bunch of errors and the map just freezes up. I&#039;ve also tried resizing the existing texture and it does the exact same thing. By doing this :</p><p>OnlineMaps.instance.texture.Resize(Screen.width, Screen.height);</p><p>Anyway, I&#039;ve attached the error messages I am getting. If I leave the texture as is, the maps work fine. But I need the map texture to match the screen size. Any ideas?</p>]]></content>
			<author>
				<name><![CDATA[raptorx81]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=502</uri>
			</author>
			<updated>2017-06-30T02:43:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2562#p2562</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2469#p2469" />
			<content type="html"><![CDATA[<p>You need to play with Screen.width and Screen.height.</p><p>Tileset is a dynamic mesh. You can use &quot;Target-Tileset&quot; only with Tileset Control.<br />Tileset is not UI element, so Canvas Scaler will not work.<br />You can make that tileset look like a 2D map. Simply set the camera perpendicular to the map.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-06-14T21:42:18Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2469#p2469</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2467#p2467" />
			<content type="html"><![CDATA[<p>Ok thanks, I&#039;ll play with Screen.currentResolution and that.<br />BTW, now that I&#039;ll need to use the Tileset controls, I experience a weird problem : The map isn&#039;t showing anymore : just a gray rectangle instead of the map<br />(I try to insert the map with the wizard, as soon as I choose Tileset in 2Dmap, the idplay of the map will becom gray)<br />Does 2D map and Tileset are incompatible?</p>]]></content>
			<author>
				<name><![CDATA[eidern]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=86</uri>
			</author>
			<updated>2017-06-14T06:42:18Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2467#p2467</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2464#p2464" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Which control do you use?</p><p>In general, you need to create a script that will resize the map dynamically.<br />For tileset: use OnlineMapsTileSetControl.Resize. <br />Keep in mind that you need to use size - N * 256, so your map will be a little bit larger than the screen.<br />For target - texture: create a new texture of the required size, and use OnlineMapsControlBase.SetTexture.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-06-13T22:51:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2464#p2464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Best way to adapt map to phones resolutions]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2463#p2463" />
			<content type="html"><![CDATA[<p>Hello,<br />I&#039;ve made my project working fine with OnlineMaps, on WebGL it works well.</p><p>But now that I&#039;m porting on android devices, i&#039;m fighting with phone resolutions.<br />How to get a correct scale of the map between all the various phone resolutions?</p><p>I&#039;ve tried to play with the Canvas scaler script (part of UI in unity) but it make the map disappear.<br />Someone got a solution to handle correctly these things?</p>]]></content>
			<author>
				<name><![CDATA[eidern]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=86</uri>
			</author>
			<updated>2017-06-13T17:58:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2463#p2463</id>
		</entry>
</feed>
