コード例 #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);
     }
 }
コード例 #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);
 }
コード例 #3
0
 //Unpause game
 private void Option1(MenuItem m, EventArgs e)
 {
     screenManager.PopGameScreen ();
 }
コード例 #4
0
ファイル: Menu.cs プロジェクト: MillenniumB/ProjectCrusade
 public void AddItem(MenuItem item)
 {
     menuItems.Add (item);
 }