public void AddScreen(GameScreen screen) { screen.ScreenManager = this; screen.Width = Game.Window.ClientBounds.Width; screen.Height = Game.Window.ClientBounds.Height; if (isInitialized) { screen.SpriteBatch = SpriteBatch; screen.Font = Font; screen.LoadContent(); } screens.Add(screen); }
public void RemoveScreen(GameScreen screen) { if (screen.ScreenManager == this) screen.ScreenManager = null; if (screens.Contains(screen)) screens.Remove(screen); }