<?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 can I make a 2D map fullscreen?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=661</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=661&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How can I make a 2D map fullscreen?.]]></description>
		<lastBuildDate>Mon, 02 Oct 2017 23:00:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2880#p2880</link>
			<description><![CDATA[<p>This is because the map must have a size of 256 * N.<br />You can set any RectTransform.sizeDelta to have a size of the map equal to the size of the canvas, but if it is different you will lose the aspect ratio.</p><p>I just checked the work of the map and script with &quot;Screen Space-Camera&quot;, and it works well.<br />Perhaps the problem is in some other setting.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 02 Oct 2017 23:00:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2880#p2880</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2877#p2877</link>
			<description><![CDATA[<p>Thank you, Alex Vertax!</p><p>The script works great! Though I noticed that the card goes beyond the canvas a bit (a UIRawImage 2D map can only be created as a canvas child), should it be so?</p><p>I also noticed that I can&#039;t use a UIRawImage 2D map if the canvas-parent is set to &quot;Screen Space-Camera&quot;. In this case, the card is not aligned to the canvas. Will the &quot;Screen Space - Camera&quot; canvas be supported for a 2D map in the future?</p><p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (Rumata)]]></author>
			<pubDate>Mon, 02 Oct 2017 21:06:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2877#p2877</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2875#p2875</link>
			<description><![CDATA[<p>Better to use UIImage or UIRawImage.<br />GUITexture is the worst choice, because it uses the old UI system.<br />In Online Maps v3 GUITexture control will be removed.</p><p>Example of how to make the adjustment of the map size to the screen size for Raw Image:<br /></p><div class="codebox"><pre><code>using UnityEngine;
using UnityEngine.UI;

public class AdjustMapToScreen3 : MonoBehaviour
{
    private int screenWidth;
    private int screenHeight;
    private Texture2D texture;

    private void ResizeMap()
    {
        screenWidth = Screen.width;
        screenHeight = Screen.height;

        int mapWidth = screenWidth / 256 * 256;
        int mapHeight = screenHeight / 256 * 256;
        if (screenWidth % 256 != 0) mapWidth += 256;
        if (screenHeight % 256 != 0) mapHeight += 256;

        if (texture != null)
        {
            if (mapWidth == texture.width &amp;&amp; mapHeight == texture.height) return;
        }

        texture = new Texture2D(mapWidth, mapHeight, TextureFormat.RGB24, false);
        OnlineMaps.instance.SetTexture(texture);
        OnlineMaps.instance.RedrawImmediately();

        RawImage rawImage = GetComponent&lt;RawImage&gt;();
        rawImage.texture = texture;
        RectTransform rt = transform as RectTransform;
        rt.sizeDelta = new Vector2(mapWidth, mapHeight);
    }

    private void Start()
    {
        ResizeMap();
    }

    private void Update()
    {
        if (screenWidth != Screen.width || screenHeight != Screen.height) ResizeMap();
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 02 Oct 2017 12:07:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2875#p2875</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2873#p2873</link>
			<description><![CDATA[<p>Hello, Alex Vertax,<br />Thank you very much for your help with the previous solution! </p><p>Yes, previously I was talking about a 3D map, now it is a 2D map with a GUITexture controller. </p><p>I was going to turn a 3D map into 2D map by disabling the &quot;Allow Camera Control&quot; option in the &quot;Online Maps Tile Control&quot; component. However, in this case, the previous solution You have sent me doesn&#039;t work since it can&#039;t control the camera distance in this case.</p><p>Also, I would appreciate your recommendation on which controller to use for the 2D map among the following (or is there any description of pros/cons for these options).</p><p><a href="https://ibb.co/kneK3w"><span class="postimg"><img src="https://thumb.ibb.co/kneK3w/Screen_Shot_2017_09_30_at_8_49_31_PM.png" alt="https://thumb.ibb.co/kneK3w/Screen_Shot_2017_09_30_at_8_49_31_PM.png" /></span></a> </p><p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (Rumata)]]></author>
			<pubDate>Sat, 30 Sep 2017 18:03:04 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2873#p2873</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2861#p2861</link>
			<description><![CDATA[<p>Hello.</p><p>Which control do you use?<br />I looked at the history of your messages, and before that you used tileset.<br />For tileset, I have already given you a solution.<br />If you ask again, then you need this for another control.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 29 Sep 2017 23:06:44 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2861#p2861</guid>
		</item>
		<item>
			<title><![CDATA[How can I make a 2D map fullscreen?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2853#p2853</link>
			<description><![CDATA[<p>How can I make a 2D map to always take the full screen of the mobile device, regardless the screen orientation? </p><p>Thank you!</p>]]></description>
			<author><![CDATA[null@example.com (Rumata)]]></author>
			<pubDate>Thu, 28 Sep 2017 15:58:13 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2853#p2853</guid>
		</item>
	</channel>
</rss>
