Esempio n. 1
0
        /// <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.Load();
            }

            screens.Add(screen);
        }
Esempio n. 2
0
 /// <summary>
 /// Override-able method that loads the screens. This is in a seperate method in case we
 /// make overrides of this class
 /// </summary>
 /// <param name="loadingQueue">The screens to load at this point in time</param>
 protected virtual void LoadScreens(GameScreen[] loadingQueue)
 {
     foreach (GameScreen screen in loadingQueue)
     {
         if (screen != null)
         {
             ScreenManager.AddScreen(screen);
         }
     }
 }
 /// <summary>
 /// Creates
 /// </summary>
 /// <param name="screen"></param>
 public ScreenComponent(GameScreen screen)
 {
     this.screen = screen;
 }
Esempio n. 4
0
        /// <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 (isInitialized)
            {
                screen.Unload();
            }

            screens.Remove(screen);
            tempScreensList.Remove(screen);
        }