コード例 #1
0
        public override Screen HandleInput(GameTime gameTime)
        {
            if (InputReader.IsMouseButtonTriggered(MouseButtons.LMB))
            {
                foreach (var button in _buttons)
                {
                    if (button.HandleMouseClick())
                    {
                        if (button.ButtonHandle.Equals("start_game_button"))
                        {
                            _screenManager.FlushAndLoad(new ScreenGame(_screenManager));
                        }
                        if (button.ButtonHandle.Equals("options_button"))
                        {
                            _screenManager.AddScreen(new ScreenOptionsMenu(_screenManager));
                        }
                        if (button.ButtonHandle.Equals("exit_button"))
                        {
                            Functions_GameControl.ExitGame();
                        }
                    }
                }
            }

            return(this);
        }
コード例 #2
0
 protected override void Initialize()
 {
     ConsoleTesting();
     Window.AllowUserResizing = true;
     InputReader.Initialize();
     Functions_GameControl.ConnectGameBase(this);
     base.Initialize();
 }