Summer Camp > Unity Game > Main Menu

July 10, 2012   ·   0 Comments


using UnityEngine;
using System.Collections;

public class StartMenuScript : MonoBehaviour {
	
public	GUISkin gSkin ;
// public Texture2D backdrop ; // our backdrop image goes in here.
private bool isLoading = false; // if true, we'll display the "Loading..." message.

	
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	void OnGUI(){



//	GUIStyle backgroundStyle  = new GUIStyle();
//	backgroundStyle.normal.background = backdrop;
//	GUI.Label (new  Rect( (Screen.width - (Screen.height * 2)) * 0.75f, 0, Screen.height * 2, Screen.height), "", backgroundStyle);
	
	
	if (gSkin)
	GUI.skin = gSkin;
	else
	Debug.Log("StartMenuGUI: GUI Skin object missing!");
	
	
	GUI.Label (new Rect( (Screen.width/2)-197, 20, 400, 100), "Lerpz Escapes",
	"mainMenuTitle");
	
		//BUTTON
		if (GUI.Button(new Rect( (Screen.width/2)-70, Screen.height - 160, 140, 70), "Play"))
		{
			isLoading = true;
			Application.LoadLevel("TheGame"); // load the game level.
		}
	
	
		 //QUIT
		var isWebPlayer = (Application.platform == RuntimePlatform.OSXWebPlayer ||
			Application.platform == RuntimePlatform.WindowsWebPlayer);
		if (!isWebPlayer)
		{
			if (GUI.Button(new Rect( (Screen.width/2)-70, Screen.height - 80, 140, 70), "Quit"))
			Application.Quit();
		}
		
		if (isLoading)
			GUI.Label (new Rect( (Screen.width/2)-110, (Screen.height / 2) - 60, 400, 70),"Loading...", "mainMenuTitle");
	
	
	}
	
	
	
}

shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Unity3D4

Amazon

adsbygoogle

Recent Posts

Categories

Amazon