/// <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() }
public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer) { screen.ScreenManager = this; screens.Add(screen); }
public void RemoveScreen(GameScreen screen) { screens.Remove(screen); }
protected override void LoadContent() { ContentManager content = Game.Content; spriteBatch = new SpriteBatch(GraphicsDevice); if (currentScreen == null) currentScreen = screens.ElementAt(0); currentScreen.LoadContent(); }