private void GameMenuScreenEvent(object obj, EventArgs e)
 {
     GameMenuScreen m = (GameMenuScreen)obj;
     switch (m.selectionIndex)
     {   //continue
         case 0:
             Screen s = mCurrentScreen;
             s.startFadingOut();
             MainGameScreen mg = (MainGameScreen)mOldScreen;
             mg.pause = false;
             mCurrentScreen = mg;
             mOldScreen = s;
             MetaGame.game.IsMouseVisible = true;
             break;
         //options
         case 1:
             break;
         //Exit game - add a prompt?
         case 2:
             screenTansition(mTitleScreen, false, false);
             break;
         default:
             break;
     }
 }
 public ScreenManager()
 {
     //Initialize the various screens in the game
     mControllerScreen = new ControllerDetectScreen(new EventHandler(ControllerDetectScreenEvent));
     mTitleScreen = new TitleScreen(new EventHandler(TitleScreenEvent));
     mLoadingScreen = new LoadingScreen(new EventHandler(LoadScreenEvent));
     mMainGameScreen = new MainGameScreen(new EventHandler(MainGameScreenEvent));
     mGameMenuScreen = new GameMenuScreen(new EventHandler(GameMenuScreenEvent));
     //Set the current screen
     mCurrentScreen = mControllerScreen;
 }
 private void MainGameScreenEvent(object obj, EventArgs e)
 {
     MainGameScreen m = (MainGameScreen)obj;
     m.pause = true;
     mOldScreen = mCurrentScreen;
     mGameMenuScreen.Reset();
     mCurrentScreen = mGameMenuScreen;
     MetaGame.game.IsMouseVisible = false;
     mCurrentScreen.startFadingIn();
 }
        private void screenTansition(Screen newScreen, bool fadeOut = true, bool fadeIn = true)
        {
            mOldScreen = mCurrentScreen;
            if (fadeOut) mOldScreen.startFadingOut();

            mCurrentScreen = newScreen;
            mCurrentScreen.Reset();
            if (fadeIn) mCurrentScreen.startFadingIn();
        }
Beispiel #5
0
        public MenuEntry(Screen parentScreen, String text)
        {
            this.screen = parentScreen;

            this.text = text;
        }