public void EraseProgress() { PlayerPrefs.DeleteAll(); menuFunction = mainMenu; //go back to main menu MainMenuScreen(); }
// Use this for initialization void Start() { screenHeight = Screen.height; screenWidth = Screen.width; menuFunction = anyKey; }
void AssemblyCSharp.IInputObserver.notify(UnityEngine.KeyCode pressedKey) { if (pressedKey == KeyCode.Escape) { menuFunction = mainMenuWithResume; //mHighScoresCache = mUnityTetris.GetCurrentHighScores ().Take (5).ToList (); NotifyObservers (AssemblyCSharp.GameState.Paused); } }
// Use this for initialization void Start() { menuFunction = SPLevelSelectMenu;// AnyKeyMenu; //On Win, Generate new Level _gameController.ON_GAME_WIN.AddListener(() => { InitNewGame(GenerateRandomSeed()); }); _gameController.ON_QUIT.AddListener(OnGameQuit); }
void anyKey() { if(Input.anyKey){ menuFunction = mainMenu; } GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth*0.45f, screenHeight*0.45f,screenWidth*0.1f,screenHeight*0.1f),"Press any key to continue"); }
public static void Main() { Console.WriteLine("Interface Menu, Press any key to Continue:"); Console.ReadLine(); MenuInterface interfaceMenu = new MenuInterface(2); interfaceMenu.MainMenu.Text = "Main"; interfaceMenu.MainMenu.SubMenu[0] = new MenuItemInterface(2, 1); interfaceMenu.MainMenu.SubMenu[0].Text = "Show Date/ Time"; interfaceMenu.MainMenu.SubMenu[0].SubMenu[0] = new MenuItemInterface(0, 2); interfaceMenu.MainMenu.SubMenu[0].SubMenu[0].Text = "Show Time"; interfaceMenu.MainMenu.SubMenu[0].SubMenu[0].Invoker = new Time(); interfaceMenu.MainMenu.SubMenu[0].SubMenu[1] = new MenuItemInterface(0, 2); interfaceMenu.MainMenu.SubMenu[0].SubMenu[1].Text = "Show Date"; interfaceMenu.MainMenu.SubMenu[0].SubMenu[1].Invoker = new Date(); interfaceMenu.MainMenu.SubMenu[1] = new MenuItemInterface(2, 1); interfaceMenu.MainMenu.SubMenu[1].Text = "Version/ Count digits"; interfaceMenu.MainMenu.SubMenu[1].SubMenu[0] = new MenuItemInterface(0, 2); interfaceMenu.MainMenu.SubMenu[1].SubMenu[0].Text = "Version"; interfaceMenu.MainMenu.SubMenu[1].SubMenu[0].Invoker = new Version(); interfaceMenu.MainMenu.SubMenu[1].SubMenu[1] = new MenuItemInterface(0, 2); interfaceMenu.MainMenu.SubMenu[1].SubMenu[1].Text = "Count Digits"; interfaceMenu.MainMenu.SubMenu[1].SubMenu[1].Invoker = new CountDig(); interfaceMenu.Show(); Console.Clear(); Console.WriteLine("Delegate Menu, Press any key to Continue:"); Console.ReadLine(); MenuDelegate delegateMenu = new MenuDelegate(2); delegateMenu.MainMenu.Text = "Main"; delegateMenu.MainMenu.SubMenu[0] = new MenuItemDelegate(2, 1); delegateMenu.MainMenu.SubMenu[0].Text = "Show Date/ Time"; delegateMenu.MainMenu.SubMenu[0].SubMenu[0] = new MenuItemDelegate(0, 2); delegateMenu.MainMenu.SubMenu[0].SubMenu[0].Text = "Show Time"; delegateMenu.MainMenu.SubMenu[0].SubMenu[0].Choosed += Time.ShowTime; delegateMenu.MainMenu.SubMenu[0].SubMenu[1] = new MenuItemDelegate(0, 2); delegateMenu.MainMenu.SubMenu[0].SubMenu[1].Text = "Show Date"; delegateMenu.MainMenu.SubMenu[0].SubMenu[1].Choosed += Date.ShowDate; delegateMenu.MainMenu.SubMenu[1] = new MenuItemDelegate(2, 1); delegateMenu.MainMenu.SubMenu[1].Text = "Version/ Count digits"; delegateMenu.MainMenu.SubMenu[1].SubMenu[0] = new MenuItemDelegate(0, 2); delegateMenu.MainMenu.SubMenu[1].SubMenu[0].Text = "Version"; delegateMenu.MainMenu.SubMenu[1].SubMenu[0].Choosed += Version.PrintVersion; delegateMenu.MainMenu.SubMenu[1].SubMenu[1] = new MenuItemDelegate(0, 2); delegateMenu.MainMenu.SubMenu[1].SubMenu[1].Text = "Count Digits"; delegateMenu.MainMenu.SubMenu[1].SubMenu[1].Choosed += CountDig.DigCount; delegateMenu.Show(); Console.Clear(); Console.WriteLine("Bye Bye"); }
// Use this for initialization void Start() { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.3f; buttonWidth = screenWidth * 0.4f; menuFunction = anyKey; }
// Use this for initialization void Start() { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.3f; buttonWidth = screenWidth * 0.4f; //here we set the menuFunction to point to the anyKey function, which is further down in the code menuFunction = anyKey; }
void anyKey() { if (Input.anyKey) { menuFunction = mainMenu; } GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.45f, screenWidth * 0.1f, screenHeight * 0.1f), "Press any key to continue"); }
void Start () { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.3f; buttonHeight1 = screenHeight * 0.15f; buttonWidth = screenWidth * 0.4f; buttonWidth1 = screenWidth * 0.2f; menuFunction = difficultyMenu; }
void Start() { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.3f; buttonHeight1 = screenHeight * 0.15f; buttonWidth = screenWidth * 0.4f; buttonWidth1 = screenWidth * 0.2f; menuFunction = difficultyMenu; }
//in order to change the GUI we just change the function that menuFunction points to. It will basically take care of itself from that point. void anyKey() { //check if the user pressed anything, if it did, change the menuFunction to show the main menu if(Input.anyKey) { menuFunction = mainMenu; } //this is just text in the center of the screen telling the user to press any key GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.45f, screenWidth * 0.1f, screenHeight * 0.1f), "Press any key to continue"); }
void anyKey() { if (Input.anyKey) { menuFunction = mainMenu; } //Sets GUI to be placed in the middle. GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.45f, screenWidth * 0.1f, screenHeight * 0.1f), "PRESS ANY KEY TO CONTINUE"); }
void anyKey() { if (Input.anyKey) { menuFunction = mainMenu; } GUI.skin = skin1; GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.25f, screenHeight * 0.45f, screenWidth * 0.5f, screenHeight * 0.5f), "Press any key to continue..."); menuState = "anykey"; Debug.Log("in anykey"); }
public void Add(string str, MenuDelegate d) { MenuItem item = items.Find(x => x.MenuString == str); if (item == null) { items.Add(new MenuItem(str, d)); } else { item.action += d; } }
void AnyKeyMenu() { int screenWidth = Screen.width; int screenHeight = Screen.height; if (Input.anyKey) { menuFunction = GameTypeMenu; } GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.45f, screenWidth * 0.1f, screenHeight * 0.1f), "Press Any Key To Continue"); }
//in order to change the GUI we just change the function that menuFunction points to. It will basically take care of itself from that point. /*void anyKey() { //check if the user pressed anything, if it did, change the menuFunction to show the main menu if(Input.anyKey) { menuFunction = mainMenu; } //this is just text in the center of the screen telling the user to press any key GUI.skin.label.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.45f, screenWidth * 0.1f, screenHeight * 0.1f), "Press any key to continue"); }*/ //mainMenu only has two buttons in the version, one to play the game, and one to quit the game void mainMenu() { if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.3f, ButtonWidth, ButtonHeight), "Start Game")) { menuFunction = levelSelect; } //if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.65f, ButtonWidth, ButtonHeight), "Options")) //{ //} if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.45f, ButtonWidth, ButtonHeight), "Quit Game")) { Application.Quit(); } }
void levelSelect() { if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.3f, ButtonWidth, ButtonHeight), "Level 1")) { Application.LoadLevel("Level1"); } if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.45f, ButtonWidth, ButtonHeight), "Level 2")) { Application.LoadLevel("Level2"); } if(GUI.Button(new Rect((ScreenWidth-ButtonWidth)*0.05f, ScreenHeight*0.6f, ButtonWidth, ButtonHeight), "Back")) { menuFunction = mainMenu; } }
void difficultyMenu() { if (GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.2f, screenHeight * 0.4f, buttonWidth1, buttonHeight1), "Easy")) { difficulty = 1; //Debug.LogError("ERROR: difficulty set to 1"); menuFunction = realMenu; } if (GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.5f, screenHeight * 0.4f, buttonWidth1, buttonHeight1), "Medium")) { difficulty = 2; menuFunction = realMenu; } if (GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.8f, screenHeight * 0.4f, buttonWidth1, buttonHeight1), "Hard")) { difficulty = 3; menuFunction = realMenu; } }
void Start() { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.15f; buttonWidth = screenWidth * 0.4f; menuFunction = mainMenu; gameStateObject = GameObject.Find ("Game State Object"); if (gameStateObject == null) { Debug.LogError ("Could not find game state object", gameStateObject); return; } gameState = (GameState) gameStateObject.GetComponent(typeof(GameState)); if (gameState == null) { Debug.LogError ("Could not find lives left script", gameState); return; } }
void GameTypeMenu() { int screenWidth = Screen.width; int screenHeight = Screen.height; float buttonWidth = screenWidth * 0.4f; float buttonHeight = screenHeight * 0.3f; if (GUI.Button(new Rect((screenWidth - buttonWidth) * 0.5f, screenHeight * 0.1f, buttonWidth, buttonHeight), "Single Player")) { menuFunction = SPLevelSelectMenu; } if (GUI.Button(new Rect((screenWidth - buttonWidth) * 0.5f, screenHeight * 0.1f + buttonHeight, buttonWidth, buttonHeight), "Multi Player")) { menuFunction = MPInitLobbyMenu; } if (GUI.Button(new Rect((screenWidth - buttonWidth) * 0.5f, screenHeight * 0.1f + (buttonHeight * 2.0f), buttonWidth, buttonHeight), "Quit Game")) { Application.Quit(); } }
public Wheel(ScreenManager screenManager, MenuDelegate menuDelegate, World world, float radius, Vector2 centerPosition, String[] entryStrings, Sprite background) { this.menuDelegate = menuDelegate; this.radius = radius; this.entries = new Dictionary<int,String>(entryStrings.Length); for(int i=0;i<entryStrings.Length;i++){ this.entries.Add(i, entryStrings[i]); } this.world = world; this.screenManager = screenManager; wheelBody = BodyFactory.CreateCircle(world, radius, 1f); wheelBody.BodyType = BodyType.Dynamic; wheelBody.Restitution = .7f; wheelBody.Friction = .2f; FixedRevoluteJoint rollingJoint = JointFactory.CreateFixedRevoluteJoint(world, wheelBody, Vector2.Zero, Vector2.Zero); wheelSprite = new Sprite(screenManager.Content.Load<Texture2D>("wheel-5")); jointTexture = screenManager.Content.Load<Texture2D>("joint"); this.background = background; phone = new Sprite(screenManager.Content.Load<Texture2D>("phone")); }
void Start() { screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.15f; buttonWidth = screenWidth * 0.4f; menuFunction = mainMenu; gameStateObject = GameObject.Find("Game State Object"); if (gameStateObject == null) { Debug.LogError("Could not find game state object", gameStateObject); return; } gameState = (GameState)gameStateObject.GetComponent(typeof(GameState)); if (gameState == null) { Debug.LogError("Could not find lives left script", gameState); return; } }
// Use this for initialization void Start() { mainMenuPanel = transform.FindChild("OpeningMenu").gameObject; levelSelectPanel = transform.FindChild("PickALevel").gameObject; eraseProgessPanel = transform.FindChild("EraseProgress").gameObject; controlsPanel = transform.FindChild("Controls").gameObject; //this will set the start screen as main menu MainMenuScreen(); screenHeight = Screen.height; screenWidth = Screen.width; buttonHeight = screenHeight * 0.15f; buttonWidth = screenWidth * 0.4f; menuFunction = mainMenu; //levelButtons = new Transform[] { level2button, level3button,level4button, level5button, level6button}; LockLevels(levelButtons); }
void anyKey() { if (Input.anyKey) { menuFunction = mainMenu; } GUI.skin.label.alignment = TextAnchor.MiddleCenter; style.fontSize = 44; style1.fontSize = 34; style2.fontSize = 24; style3.fontSize = 24; style.normal.textColor = Color.red; style1.normal.textColor = Color.red; style2.normal.textColor = Color.blue; style3.normal.textColor = Color.red; style.alignment = TextAnchor.MiddleCenter; style1.alignment = TextAnchor.MiddleCenter; style2.alignment = TextAnchor.MiddleCenter; style3.alignment = TextAnchor.MiddleCenter; GUI.Label(new Rect(Screen.width / 2 - 300, Screen.height / 2 - 20, 600, 40), "HUNGRY MAN!", style); GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.55f, screenWidth * 0.1f, screenHeight * 0.1f), "Press Any Key to Continue!", style1); GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.75f, screenWidth * 0.1f, screenHeight * 0.1f), "<Use Arrow Keys to Play Game>", style2); GUI.Label(new Rect(screenWidth * 0.45f, screenHeight * 0.65f, screenWidth * 0.1f, screenHeight * 0.1f), "\"Eating broccoli's will cause death!\"", style3); }
void difficultyMenu() { if(GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.2f, screenHeight * 0.4f, buttonWidth1, buttonHeight1), "Easy")) { difficulty = 1; //Debug.LogError("ERROR: difficulty set to 1"); menuFunction = realMenu; } if(GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.5f, screenHeight* 0.4f, buttonWidth1, buttonHeight1), "Medium")) { difficulty = 2; menuFunction = realMenu; } if(GUI.Button(new Rect((screenWidth - buttonWidth1) * 0.8f, screenHeight * 0.4f, buttonWidth1, buttonHeight1), "Hard")) { difficulty = 3; menuFunction = realMenu; } }
void AssemblyCSharp.IClassicTetrisStateObserver.notify(AssemblyCSharp.ClassicTetrisStateUpdate stateUpdate) { if (stateUpdate == AssemblyCSharp.ClassicTetrisStateUpdate.GameEnded) { menuFunction = mainMenu; } }
// Use this for initialization void Start() { ScreenHeight = Screen.height; ScreenWidth = Screen.width; ButtonHeight = ScreenHeight / 10; ButtonWidth = ScreenWidth / 3; //here we set the menuFunction to point to the anyKey function, which is further down in the code menuFunction = mainMenu; }
public void Enable(string message, string option1, string option2, MenuDelegate confirm, MenuDelegate decline) => enableMethod(ConfirmationMenu, message, option1, option2, confirm, decline);
private void mainMenuWithResume() { if (GUI.Button (new Rect ((mScreenWidth - mButtonWidth) * 0.5f, mScreenHeight * 0.1f, mButtonWidth, mButtonHeight), "Continue Game")) { menuFunction = inGameHUD; NotifyObservers (AssemblyCSharp.GameState.Running); } if (GUI.Button (new Rect ((mScreenWidth - mButtonWidth) * 0.5f, mScreenHeight * 0.4f, mButtonWidth, mButtonHeight), "Start New Game")) { menuFunction = inGameHUD; NotifyObservers (AssemblyCSharp.GameState.Ended); NotifyObservers (AssemblyCSharp.GameState.Running); } if (GUI.Button (new Rect ((mScreenWidth - mButtonWidth) * 0.5f, mScreenHeight * 0.7f, mButtonWidth, mButtonHeight), "Quit Game")) { Application.Quit (); } AddBlockCount (); AddLeaderboard (); }
public void AddLeftActiveFunctionalityToControl(String name, MenuDelegate del) { Controls[name].SetLeftDelegate(del); }
public void AddCancel(MenuDelegate can) { Cancel = can; }
public void SetLeftDelegate(MenuDelegate left) { LeftPress = left; }
// Use this for initialization private void Start() { mScreenHeight = Screen.height; mScreenWidth = Screen.width; mButtonHeight = mScreenHeight * 0.2f; mButtonWidth = mScreenWidth * 0.4f; menuFunction = mainMenu; //Register with the input controller so I observer updates GameObject go = GameObject.Find ("GameObject"); AssemblyCSharp.PlayerControl inputController = (AssemblyCSharp.PlayerControl)go.GetComponent (typeof(AssemblyCSharp.PlayerControl)); inputController.RegisterObserver (this); mUnityTetris = (AssemblyCSharp.UnityTetris)go.GetComponent (typeof(AssemblyCSharp.UnityTetris)); }
public MenuItem(string str, MenuDelegate d) { MenuString = str; action += d; }
public MDMenu(CommandManager manager, CommandEntrySet ces, CommandSource commandSource, object initialCommandTarget, EventHandler closeHandler) { Delegate = new MenuDelegate(closeHandler); AutoEnablesItems = false; var label = ces.Name ?? ""; Title = ContextMenuItem.SanitizeMnemonics(label); foreach (CommandEntry ce in ces) { if (ce.CommandId == Command.Separator) { AddItem(NSMenuItem.SeparatorItem); if (!string.IsNullOrEmpty(ce.OverrideLabel)) { AddItem(new MDMenuHeaderItem(ce)); } continue; } if (string.Equals(ce.CommandId as string, servicesID, StringComparison.Ordinal)) { AddItem(new MDServicesMenuItem()); continue; } var subset = ce as CommandEntrySet; if (subset != null) { AddItem(new MDSubMenuItem(manager, subset, commandSource, initialCommandTarget)); continue; } var lce = ce as LinkCommandEntry; if (lce != null) { AddItem(new MDLinkMenuItem(lce)); continue; } Command cmd = ce.GetCommand(manager); if (cmd == null) { LoggingService.LogError("MacMenu: '{0}' maps to null command", ce.CommandId); continue; } if (cmd is CustomCommand) { LoggingService.LogWarning("MacMenu: '{0}' is unsupported custom-rendered command' '", ce.CommandId); continue; } var acmd = cmd as ActionCommand; if (acmd == null) { LoggingService.LogWarning("MacMenu: '{0}' has unknown command type '{1}'", cmd.GetType(), ce.CommandId); continue; } AddItem(new MDMenuItem(manager, ce, acmd, commandSource, initialCommandTarget)); } }
public Menu(String menuName, MenuDelegate menuDelegate) { this.menuName = menuName; del = menuDelegate; }
public void SetRightDelegate(MenuDelegate right) { RightPress = right; }
public void AddReach(MenuDelegate reach) { ReachDestination = reach; }
public void AddUpdateMethod(MenuDelegate init) { UpdateMethod = init; }
public void SetActivateDelegate(MenuDelegate del) { Activate = del; }
public void AddUnreach(MenuDelegate unReach) { UnReachDestination = unReach; }
public MenuItem(string command, string desc, MenuDelegate callback) { Command = command; Description = desc; Callback = callback; }
private void mainMenu() { if (GUI.Button (new Rect ((mScreenWidth - mButtonWidth) * 0.5f, mScreenHeight * 0.25f, mButtonWidth, mButtonHeight), "Start New Game")) { //make sure to kick off new game menuFunction = inGameHUD; NotifyObservers (AssemblyCSharp.GameState.Ended); NotifyObservers (AssemblyCSharp.GameState.Running); } if (GUI.Button (new Rect ((mScreenWidth - mButtonWidth) * 0.5f, mScreenHeight * 0.5f, mButtonWidth, mButtonHeight), "Quit Game")) { Application.Quit (); } mUnityTetris.Scene.RegisterObserver (this); AddLeaderboard (); }