ok what i am basically intending to do is make a small box in the lower right corner with a button. this button will take you to level one. above the box i want to display a GUITexture element of my games logo. right above it.
my problem is the gui texture is not right above it but half way up the screen.
here is my code
var symbolic_logo : GUITexture;
var screen_width : float;
var screen_height : float;
var gui_menu : Rect;
var gui_newgame : Rect;
function Start () {
symbolic_logo.transform.position = Vector3.zero;
symbolic_logo.transform.localScale = Vector3.zero;
screen_width = Screen.width;
screen_height = Screen.height;
gui_menu = Rect (screen_width - 200, screen_height - 100, 200, 100);
gui_newgame = Rect (screen_width - 175 , screen_height - 75 , 150, 50);
symbolic_logo.pixelInset = Rect (gui_menu.x , gui_menu.y, 128, 58);
}
function OnGUI () {
// Make a background box
GUI.Box (gui_menu, "Welcome");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button (gui_newgame, "New Game")) {
Application.LoadLevel (1);
}
}
@script RequireComponent(GUITexture)
what exactly am i doing wrong here?