/// <summary> /// The constructor is private: loading screens should /// be activated via the static Load method instead. /// </summary> private LoadingScreen(ScreenManager screenManager, bool loadingIsSlow, GameScreen[] screensToLoad) { this.loadingIsSlow = loadingIsSlow; this.screensToLoad = screensToLoad; 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 (isInitialized) { screen.Activate(false); } screens.Add(screen); }
public void RemoveScreen(GameScreen screen) { //unload content if (isInitialized) { screen.Unload(); } screens.Remove(screen); tempScreensList.Remove(screen); }