public void AddScreen(GameScreen screen, PlayerIndex? controllingPlayer) { screen.ControllingPlayer = controllingPlayer; screen.ScreenManager = this; screen.IsExiting = false; if (isInitialized) { screen.Activate(false); } screens.Add(screen); TouchPanel.EnabledGestures = screen.EnabledGestures; }
public void RemoveScreen(GameScreen screen) { if (isInitialized) { screen.Unload(); } screens.Remove(screen); tempScreenList.Remove(screen); if (screens.Count > 0) { TouchPanel.EnabledGestures = screens[screens.Count - 1].EnabledGestures; } }