I have a gui menu I created through code, and a in-game GUI Text game object. I want the game Object to appear above the GUI menu I created.
I have tried using two cameras with one at a lower depth but it isn’t working. Any ideas how this can be achieved?
Here is the code for my Menu:
function OnGUI() {
GUI.skin=customSkin;
Screen.lockCursor = false;
var winPromptW:int = Screen.width/1.2;
var winPromptH:int = Screen.height/2;
var halfScreenW:float = Screen.width/2;
var halfScreenH:float = Screen.height/2;
var halfPromptW:int = winPromptW/2;
var halfPromptH:int = winPromptH/2;
if (gameOver == true){
GUI.BeginGroup(Rect(halfScreenW-halfPromptW, halfScreenH-halfPromptH*1.5, winPromptW, winPromptH));
GUI.Box (Rect (0,0,winPromptW,winPromptH),"");
var buttonW:int = Screen.width/6;
var buttonH:int = buttonW;
if(GUI.Button(Rect(halfPromptW-(buttonW)-Screen.width/30,winPromptH-(buttonW*1.4),buttonW,buttonH),play)){
Application.LoadLevel("Main");
}
if(GUI.Button(Rect(halfPromptW+Screen.width/30,winPromptH-(buttonW*1.4),buttonW,buttonH),quit)){
Application.LoadLevel("Title");
}
GUI.EndGroup();
}
}