1 (edited by Rumata 2017-09-14 18:13:51)

Topic: How to make 3D map fullscreen?

How can I make a 3D map to always take a full screen of the phone, regardless of the screen orientation?
Thank you!

Re: How to make 3D map fullscreen?

Hello.

Example:

using UnityEngine;

public class AdjustMapToScreen2 : MonoBehaviour
{
    private int screenWidth;
    private int screenHeight;

    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;
        OnlineMapsTileSetControl.instance.Resize(mapWidth, mapHeight);

        OnlineMapsTileSetControl.instance.cameraDistance = screenHeight * 0.9f;
    }

    private void Start()
    {
        ResizeMap();
    }

    private void Update()
    {
        if (screenWidth != Screen.width || screenHeight != Screen.height) ResizeMap();
    }
}
Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: How to make 3D map fullscreen?

Thank you, it makes the map size equal to screen size initially, but if I will change the angle of the camera I will see the map "floating in the air". Is there a way to always keep it fullscreen, just like in a car navigator apps for example?

Re: How to make 3D map fullscreen?

You are going in the wrong direction.
You do not need to make a round fullscreen map.
In your case, this is much easier.
You just need to set up fog and "Camera / Clipping Planes / Far" in your scene.
Something like:
http://forum.infinity-code.com/viewtopi … 1423#p1423

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.