GUI Resolution Messed Up

Hey i have tried everything i know on how to position the GUI in my code in the right spot depending on the resolution and still something is wrong. I built the game and now the GUI is all to the left and not positioned where i put it in the editor. Any Help would be nice thanks.

-Christian j

code:
using UnityEngine;
using System.Collections;

public class GameMenu : MonoBehaviour {

private bool mainMenuActive;
private bool newGame  = false;
private bool loadGame = false;
private bool onlineGame = false;
private bool gameOptions = false;
private bool gameUpdates = false;

void Start()
{
	mainMenuActive = true;
}

void OnGUI()
{
	 
	if(mainMenuActive ==  true)
	{
		MainMenu();
	}
	//MenuPlayerChoiceGUI

}

void MainMenu()
{
	//Top-Bottom Bars
	GUI.Box (new Rect (Screen.width /2 - 688, Screen.height /2  + 275,    8000, 50), "");
	GUI.Box (new Rect (Screen.width /2 - 688, Screen.height /2 - 330,   8000, 50), "");

	//Buttons
	if (GUI.Button (new Rect (Screen.width / 2 - 600 , Screen.height / 2 - 315, 100, 30), "New Game")) 
	{
		NewGame();
	}
	if(GUI.Button (new Rect (Screen.width / 2 - 480, Screen.height / 2 - 315, 100, 30), "Load Game"))
	{
		LoadGame();
	}
	if(GUI.Button (new Rect (Screen.width / 2 - 360, Screen.height / 2 - 315, 100, 30), "Online"))
	{
		Online();	
	}
	if (GUI.Button (new Rect (Screen.width / 2 - 240, Screen.height / 2 - 315, 100, 30), "Options")) 
	{
		Options();
	}
	if(GUI.Button (new Rect (Screen.width / 2 - 120, Screen.height / 2 - 315, 100, 30), "Updates"))
	{
		Updates();
	}
	if (GUI.Button (new Rect (Screen.width / 2 - 0, Screen.height / 2 - 315, 100, 30), "Exit")) 
	{
		Application.Quit();
	}

	//Game Version
	GUI.Label (new Rect (Screen.width / 2 - 0, Screen.height / 2 + 320, 100, 30), "Alpha 1.0");

}

void NewGame()
{
	GUI.Box (new Rect (Screen.width / 2 + 100, Screen.height / 2 - 275, 500, 545), "");
}
void LoadGame()
{
	GUI.Box (new Rect (Screen.width / 2 + 100, Screen.height / 2 - 275, 500, 545), "");
}
void Online()
{
	GUI.Box (new Rect (Screen.width / 2 + 100, Screen.height / 2 - 275, 500, 545), "");
}
void Options()
{
	GUI.Box (new Rect (Screen.width / 2 + 100, Screen.height / 2 - 275, 500, 545), "");
}
void Updates()
{
	GUI.Box (new Rect (Screen.width / 2 + 100, Screen.height / 2 - 275, 500, 545), "");
}

}

I would highly recommend switching to the new Unity UI system, using a Canvas and such; It makes it much much easier to position UI elements in the correct place, as well as just being more powerful and customizable in general. You can also set it to automatically scale with your screen size, so no matter what size the window is, everything will look correct. You can find some info to get started here: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

As for why all your stuff is off to the left, a lot of the numbers you’re using there seem to be fairly large. Your new game button for example: if your screen is only 1000 pixels wide (the screen in the editor is not usually all that large), then your code will place the left side of the button at -100 pixels (1000 / 2 is 500, minus 600 is -100). The button itself is only 100 pixels wide, so it wouldn’t even show up on the screen in that case (because the right side of it would be a 0, which is the left side of the screen).

Since you positioned everything in the editor using the correct numbers, the buttons and such will always be at the correct positions for the editor window. However, as soon as you build the game and play it in a large or smaller window, everything is going to be offset, because the window simple isn’t the same size.