示例#1
0
        /// <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;
                });
            }
        }
示例#2
0
        /// <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;
                });
            }
        }
示例#3
0
        /// <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;
                });
            }
        }
示例#4
0
        /// <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;
                });
            }
        }