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!
You are not logged in. Please login or register.
Infinity Code Forum → Online Maps Help → 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!
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();
}
}
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?
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
Infinity Code Forum → Online Maps Help → How to make 3D map fullscreen?
Powered by PunBB, supported by Informer Technologies, Inc.