place gui on screen

var buttonHeight : int = 50;
var buttonWidth : int = 100;

function Update () {
}

function OnGUI () {
if (GUI.Button (Rect (Screen.width - (buttonWidth/2),Screen.height-(buttonHeight/2), buttonWidth, buttonHeight), “return menu”)) {

	Application.LoadLevel(1);
}

}

I use up script to place my gui on screen in editor, in game view tab, I change the free aspect to Ipad Wid 1024*768,but i run the app,i can’t see the gui on the screen.If i print the screen size,width is 1024 but height is 501,Is there someting wrong?

It looks like you are placing your button right at the edges of your screen.
If you want to put the button more in the middle, divide the screen height and width by 2.

i.e…

function OnGUI () {

if (GUI.Button (Rect ((ScreenWidth / 2 )- (buttonWidth/2),(ScreenHeight / 2) -(buttonHeight/2), buttonWidth, buttonHeight), “return menu”)) {

Application.LoadLevel(1);

}