Exemplo n.º 1
0
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        protected LoadingScreen(bool loadingIsSlow, GameScreen[] screensToLoad)
        {
            _loadingIsSlow = loadingIsSlow;
            _screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.0);
        }
Exemplo n.º 2
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.LoadContent();
            }

            _screens.Add(screen);
            InvokeScreensChanged(EventArgs.Empty);
        }
Exemplo n.º 3
0
 protected InformativeLoadingScreen(bool loadingIsSlow, GameScreen[] screensToLoad)
     : base(loadingIsSlow, screensToLoad)
 {
     // blank
 }
Exemplo n.º 4
0
 public ScreenLoadedEventArgs(GameScreen screen)
 {
     Screen = screen;
 }
Exemplo n.º 5
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.UnloadContent();
            }

            _screens.Remove(screen);
            _screensToUpdate.Remove(screen);

            InvokeScreensChanged(EventArgs.Empty);
        }