<?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 — Best way to adapt map to phones resolutions]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=570</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=570&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Best way to adapt map to phones resolutions.]]></description>
		<lastBuildDate>Tue, 04 Jul 2017 21:33:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2577#p2577</link>
			<description><![CDATA[<p>Thanks Alex, much appreciated!</p>]]></description>
			<author><![CDATA[null@example.com (raptorx81)]]></author>
			<pubDate>Tue, 04 Jul 2017 21:33:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2577#p2577</guid>
		</item>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2572#p2572</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 01 Jul 2017 20:29:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2572#p2572</guid>
		</item>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2562#p2562</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (raptorx81)]]></author>
			<pubDate>Fri, 30 Jun 2017 02:43:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2562#p2562</guid>
		</item>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2469#p2469</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Jun 2017 21:42:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2469#p2469</guid>
		</item>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2467#p2467</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (eidern)]]></author>
			<pubDate>Wed, 14 Jun 2017 06:42:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2467#p2467</guid>
		</item>
		<item>
			<title><![CDATA[Re: Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2464#p2464</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 13 Jun 2017 22:51:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2464#p2464</guid>
		</item>
		<item>
			<title><![CDATA[Best way to adapt map to phones resolutions]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2463#p2463</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (eidern)]]></author>
			<pubDate>Tue, 13 Jun 2017 17:58:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2463#p2463</guid>
		</item>
	</channel>
</rss>
