Exemplo n.º 1
0
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager,
                                 GameScreen screenToLoad)
        {
            // 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,
                                                            screenToLoad);

            screenManager.AddScreen(loadingScreen);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor is private, the Loading Screen should be called via the static Load() method.
 /// </summary>
 /// <param name="screenManager">The Screen Manager that the GameScreen should be loaded to.</param>
 /// <param name="screenToLoad">The Screen that needs to be loaded.</param>
 private LoadingScreen(ScreenManager screenManager,
     GameScreen screenToLoad)
 {
     this.screenToLoad = screenToLoad;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Remove a screen from the screenmanager.
 /// </summary>
 /// <param name="screen"></param>
 public void RemoveScreen(GameScreen screen)
 {
     screen.UnloadContent();
     screens.Remove(screen);
     screensToUpdate.Remove(screen);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Add a screen to the screenmanager.
        /// </summary>
        /// <param name="screen"></param>
        public void AddScreen(GameScreen screen)
        {
            screen.ScreenManager = this;
            screens.Add(screen);

            if (isInitialized)
            {
                screen.Initialize();
                screen.LoadContent();
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Remove a screen from the screenmanager.
 /// </summary>
 /// <param name="screen"></param>
 public void RemoveScreen(GameScreen screen)
 {
     screen.UnloadContent();
     screens.Remove(screen);
     screensToUpdate.Remove(screen);
 }