/// <summary> /// Private constructor; loading screens should be activated via the static Load /// method instead /// </summary> /// <param name="aScreenManager"></param> /// <param name="mLoadingIsSlow"></param> /// <param name="aScreensToLoad"></param> private LoadingScreen(ScreenManager aScreenManager, bool aLoadingIsSlow, GameScreen[] aScreensToLoad) { mLoadingIsSlow = aLoadingIsSlow; mScreensToLoad = aScreensToLoad; TransitionOnTime = TimeSpan.FromSeconds(0.5); }
/// <summary> /// Adds a new screen to the screen manager. /// </summary> public void AddScreen(GameScreen screen) { screen.ScreenManager = this; screen.IsExiting = false; // If we have a graphics device, tell the screen to load content. if (mIsInitialized) { screen.LoadContent(); } mScreens.Add(screen); }
/// <summary> /// Removes a screen from the screen manager. You should normally /// use GameScreen.ExitScreen instead of calling this directly, so /// the screen can gradually transition off rather than just being /// instantly removed. /// </summary> public void RemoveScreen(GameScreen screen) { // If we have a graphics device, tell the screen to unload content. if (mIsInitialized) { screen.UnloadContent(); } mScreens.Remove(screen); mScreensToUpdate.Remove(screen); }