/// <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. var loadingScreen = new LoadingScreen(loadingIsSlow, screensToLoad); screenManager.AddScreen(loadingScreen, controllingPlayer); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> private void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
private void entry_Selected(object sender, PlayerIndexEventArgs e) { string Level = ((MenuEntry)sender).Text; LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GamePlayScreen(Level, ScreenManager)); }