I am a new in unity. I want to make a 2D game but I don’t know how to setup camera that showing just a background image(plane with texture) in full screan when you playing a game? For example a hidden object game have a scene that is static don’t have a movement and scene is fitted to the screen when you playing game.
Try this script:
you have to attach a gui texture component and name the script “FullScreen”, put the texture you want to display in the gui texture
using UnityEngine;
using System.Collections;
public class FullScreen : MonoBehaviour
{
void Start ()
{
float ScreenWidth = Screen.width;
float ScreenHeight = Screen.height;
float PixelInsetX = (Screen.width / 2) * -1;
float PixelInsetY = (Screen.height / 2) * -1;
guiTexture.pixelInset = new Rect(PixelInsetX, PixelInsetY, ScreenWidth, ScreenHeight);
}
}
Thanks very much… Works great…
guiTexture is obsolete