コード例 #1
0
ファイル: ScreenManager.cs プロジェクト: RobLoach/TOBam
        /// <summary>
        /// Removes a screen from the screen manager. You should normally
        /// use Screen.ExitScreen instead of calling this directly, so
        /// the screen can gradually transition off rather than just being
        /// instantly removed.
        /// </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.UnloadGraphicsContent(true);
            }

            screens.Remove(screen);
            screensToUpdate.Remove(screen);
        }
コード例 #2
0
ファイル: ScreenManager.cs プロジェクト: RobLoach/TOBam
        /// <summary>
        /// Adds a new screen to the screen manager.
        /// </summary>
        public void AddScreen(Screen screen)
        {
            screen.ScreenManager = this;

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

            screens.Add(screen);
        }