Beispiel #1
0
        /// <summary>
        /// Transition to the next screen.
        /// </summary>
        /// <param name="type">Next screen to transition to.</param>
        /// <param name="message">Pass a message on to the next screen </param>
        public void Transition(Type type, string message)
        {
            currentScreen.UnloadContent();
            for (int i = 0; i < screens.Count(); i ++)
            {
                if (screens[i].GetType() == type)
                    currentScreen = screens[i];
            }
            currentScreen.Transition(message);
            currentScreen.LoadContent();

            //currentScreen.Update()
        }
Beispiel #2
0
 public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer)
 {
     screen.ScreenManager = this;
     screens.Add(screen);
 }
Beispiel #3
0
 public void RemoveScreen(GameScreen screen)
 {
     screens.Remove(screen);
 }
Beispiel #4
0
 protected override void LoadContent()
 {
     ContentManager content = Game.Content;
     spriteBatch = new SpriteBatch(GraphicsDevice);
     if (currentScreen == null)
         currentScreen = screens.ElementAt(0);
     currentScreen.LoadContent();
 }