/// <summary> /// Change the current screen. /// But don't show an transition /// This will load the content of the screen if necessary /// </summary> /// <param name="screen">The screen to add to the stack</param> public void SetScreenNoTransition(BaseScreen screen) { screenStack.Add(screen); if (!screen.isContentLoaded) { Task.Factory.StartNew(() => { this.state = State.Loading; screen.LoadContent(Game1.Instance.Content); this.state = State.Running; }); } }
/// <summary> /// Change the current screen. /// This will load the content of the screen if necessary /// </summary> /// <param name="screen">The screen to add to the stack</param> public void SetScreen(BaseScreen screen) { screenStack.Add(screen); if (!screen.isContentLoaded) { Task.Factory.StartNew(() => { this.state = State.Loading; screen.LoadContent(Game1.Instance.Content); this.transition = TransitionFactory.GetTransition(screen.transitionKind); this.transition.Start(); this.state = State.Transitioning; }); } }