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;
            }
        }