//mainmenu.js by mactinite
//Simple main menu
var areaHeight : float= 200;
var areaWidth : float= 200;
var layoutCenter : float = 100;
var firstLevel : String = "First";
var buttonSpacing : float = 25;
var customSkin : GUISkin;
var layoutStyle : GUIStyle;
var textureTop : Texture2D;
function OnGUI(){
GUI.skin = customSkin;
GUILayout.BeginArea(Rect(Screen.width/2-areaWidth/2,Screen.height/2-areaHeight/2,areaWidth,areaHeight),layoutStyle);
GUILayout.Space(25);
GUILayout.Label(textureTop);
GUILayout.Space(buttonSpacing);
if(GUILayout.Button("Start Game")){
Application.LoadLevel(firstLevel);
}
GUILayout.Space(buttonSpacing);
if(GUILayout.Button("Quit")){
Application.Quit();
}
GUILayout.EndArea();
}
Thursday, February 2, 2012
Main Menu
Here's the main menu script. Take a look, ask any questions in the comments.
Labels:
Development,
Main Menu,
Resources,
Scripts,
UnityScript
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment