- Home /
Question by
shepsaus000 · May 18, 2016 at 05:22 PM ·
camerascripting problemtexturetextcanvas
Can't see text for menu in unity with a texture placed
So I'm creating a menu in Unity and I had a canvas set up to show some text necessary to navigate the menu. My problem arises with the following script that I put on my camera:
using UnityEngine;
using System.Collections;
public class MenuDisplayScript : MonoBehaviour {
public Texture backgroundTexture;
void OnGUI(){
//Display our background Texture
GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), backgroundTexture);
}
}
The image I have in this script seems to go over the text in the menu, so what am I doing wrong?
Comment
Answer by FortisVenaliter · May 18, 2016 at 06:21 PM
The GUI class represents the old GUI system, which goes over the new one. You don't want to use them together generally. Stick to the new GUI system by creating a background image object.