public void changeScreen(Screen newScreen) { currentScreen.Unload(); Components.Remove(currentScreen); this.currentScreen = newScreen; Components.Add(currentScreen); }
public MenuItem(Game1 game, string text, Vector2 pos, Screen screen) : base(game) { this.game = game; this.text = text; this.pos = pos; this.screen = screen; game.Components.Add(this); }
protected override void Initialize() { graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 800; graphics.ApplyChanges(); currentScreen = new SplashScreen(this); cursor = new Cursor(this); Components.Add(currentScreen); Components.Add(cursor); base.Initialize(); }