/// <summary> /// Closes a gameScreen from the stack and frees up any memory from it /// </summary> /// <param name="gameScreen">The screen to remove</param> public static void RemoveScreen(GameScreen gameScreen) { gameScreen.UnloadAssets(); ScreenList.Remove(gameScreen); }
/// <summary> /// Switches the focus from one gameScreen to another /// </summary> /// <param name="currentScreen">The screen to switch from</param> /// <param name="targetScreen">The screen to switch to</param> public static void ChangeScreens(GameScreen currentScreen, GameScreen targetScreen) { RemoveScreen(currentScreen); AddScreen(targetScreen); }
/// <summary> /// Adds a new game screen to the stack /// </summary> /// <param name="gameScreen">The new screen to add</param> public static void AddScreen(GameScreen gameScreen) { if (ScreenList == null) { ScreenList = new List<GameScreen>(); } ScreenList.Add(gameScreen); gameScreen.LoadAssets(); }