/// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, bool loadingIsSlow,
                                PlayerIndex? controllingPlayer,
                                params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in screenManager.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(screenManager,
                                                            loadingIsSlow,
                                                            screensToLoad);

            screenManager.AddScreen(loadingScreen, controllingPlayer);
        }
Exemple #2
0
 public void LoadMainMenu()
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(),
                        new MainMenuScreen());
 }
 /// <summary>
 /// Event handler for when the Play Movie menu entry is selected.
 /// </summary>
 void PlayMovieMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, true, e.PlayerIndex,
                        new MovieScreen());
 }
 /// <summary>
 /// Event handler for when the Instructions menu entry is selected.
 /// </summary>
 void InstructionsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, e.PlayerIndex, new InstructionsScreen());
 }
 /// <summary>
 /// User has won the game, show a "You won!" message and return to the main menu
 /// </summary>
 private void WonTheGame()
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
     ScreenManager.AddScreen(new WonGameScreen(), ControllingPlayer);
 }
 /// <summary>
 /// Ends the current game and returns to the main menu.
 /// </summary>
 public void GameOver()
 {
     isGameOver = true;
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
     ScreenManager.AddScreen(new GameOverScreen(), ControllingPlayer);
 }