コード例 #1
0
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen( ScreenManager screenManager, bool loadingIsSlow,
                              Screen[] screensToLoad )
        {
            State = ScreenState.Active;
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            //TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
コード例 #2
0
        /// <summary>
        /// //Adds a screen to the top of the manager
        /// </summary>
        public void AddScreen( Screen screen )
        {
            screen.ScreenManager = this;
            screen.Initialize();

            // If we have a graphics device, tell the screen to load content.
            if ( ( graphicsDeviceService != null ) &&
                ( graphicsDeviceService.GraphicsDevice != null ) ) {
                screen.LoadContent();
            }

            Screens.Add( screen );
        }
コード例 #3
0
 /// <summary>
 /// //Removes a screen from the ScreenManager
 /// </summary>
 public void RemoveScreen( Screen screen )
 {
     // If we have a graphics device, tell the screen to unload content.
     if ( ( graphicsDeviceService != null ) &&
         ( graphicsDeviceService.GraphicsDevice != null ) ) {
         screen.UnloadContent();
     }
     screen.State = Screen.ScreenState.Inactive;
     Screens.Remove( screen );
 }