GameStateManagement.GameScreen.ExitScreen C# (CSharp) Метод

ExitScreen() публичный Метод

Tells the screen to go away. Unlike ScreenManager.RemoveScreen, which instantly kills the screen, this method respects the transition timings and will give the screen a chance to gradually transition off.
public ExitScreen ( ) : void
Результат void
        public void ExitScreen()
        {
            if (TransitionOffTime == TimeSpan.Zero)
            {
                // If the screen has a zero transition time, remove it immediately.
                ScreenManager.RemoveScreen(this);
            }
            else
            {
                // Otherwise flag that it should transition off and then exit.
                isExiting = true;
            }
        }

Usage Example

Пример #1
0
        private void DebutAnimation(float time)
        {
            if (_timer < _timer_max)
            {
                _timer += time;
            }
            else if (_timer > _timer_max)
            {
                foreach (GameScreen screen in screensToLoad)
                {
                    if (screen != null)
                    {
                        ScreenManager.AddScreen(screen);
                    }
                }
                // Tell all the current screens to transition off.
                screenToErrase.ExitScreen();

                transitionDone = true;
            }
        }