Ejemplo n.º 1
0
 //Quit
 private void Option2(MenuItem m, EventArgs e)
 {
     //TODO: make more elegant. Currently there is an issue with objects being disposed, etc.
     try
     {
     game.Exit ();
     }
     catch(NullReferenceException ex) {
         Console.WriteLine(ex.StackTrace);
     }
 }
Ejemplo n.º 2
0
 public PauseMenuScreen(GameScreenManager _screenManager, MainGame game)
 {
     screenManager = _screenManager;
     prevKeyboardState = Keyboard.GetState ();
     menu = new Menu ((new Vector2(MainGame.WindowWidth*0.5f, MainGame.WindowHeight*0.5f)), "Arial", 20);
     MenuItem menuItem1 = new MenuItem ("Resume");
     menuItem1.Activated += new MenuItem.ActivatedHandler (Option1);
     MenuItem menuItem2 = new MenuItem ("Quit");
     menuItem1.Activated += new MenuItem.ActivatedHandler (Option2);
     menu.AddItem (menuItem1);
     menu.AddItem (menuItem2);
 }
Ejemplo n.º 3
0
 //Unpause game
 private void Option1(MenuItem m, EventArgs e)
 {
     screenManager.PopGameScreen ();
 }
Ejemplo n.º 4
0
 public void AddItem(MenuItem item)
 {
     menuItems.Add (item);
 }