Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


RyanSchurton

Member Since 02 Mar 2012
Offline Last Active Mar 02 2012 12:16 AM

Posts I've Made

In Topic: 2d Space shooter Main Menu Problem

02 March 2012 - 12:17 AM

using UnityEngine;
using System.Collections;
public class MainMenu : MonoBehaviour
{
#region Fields
private string instructionText = "Instruction:\nPress Left and Right Awrrows to move.\nPress Spacebar to fire."
private int buttonWidth = 200;
private int buttonHeight = 50;
#endregion
#region Properties
#endregion
#region Functions
void OnGui()
{
  GUI.Label(new Rect(10, 10, 250, 200), instructionText);
  if (GUI.Button(new Rect((Screen.width / 2) - (buttonWidth / 2),
					   Screen.height / 2 - buttonHeight / 2, buttonWidth, buttonHeight), "Start Game"));
  {
	Application.LoadLevel(1);				
  }

}

#endregion
}


sorry about what happen above and the double post but this is the code for my main menu.

PARTNERS