/// <summary> /// Draws the loading screen. /// </summary> public override void Draw(GameTime gameTime) { // If all the previous screens have transitioned off, then this will be the only active screen. // This is our cue to begin loading the next screen. if ((ScreenState == ScreenState.Active) && ScreenManager.GetScreens().Length == 1) { otherScreensAreGone = true; } }
/// <summary> /// Activates the loading screen and loads up the next screen with the provided callback. /// </summary> public static void Load(ScreenManager screenManager, EventHandler<EventArgs> loadNextScreen) { // 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(); loadingScreen.loadNextScreen = loadNextScreen; screenManager.AddScreen(loadingScreen); }
/// <summary> /// Activates the loading screen and loads up the next screen with the provided callback. /// </summary> public static void Load(ScreenManager screenManager, EventHandler <EventArgs> loadNextScreen) { // 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(); loadingScreen.loadNextScreen = loadNextScreen; screenManager.AddScreen(loadingScreen); }