/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { Game1.self.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend); if (popupToDraw != null) { Darker.CurrentTechnique.Passes[0].Apply(); popupToDraw.Draw(spriteBatch); } Game1.self.spriteBatch.Draw(Game1.self.Wallpaper, new Vector2(0, 0), Color.White); switch (state) { case State.MainMenu: mainMenu.Draw(gameTime); break; case State.OptionsMenu: settingsMenu.Draw(gameTime); break; case State.LoginMenu: loginMenu.Draw(gameTime); break; case State.RegisterMenu: registerMenu.Draw(gameTime); break; case State.DeckMenu: deckMenu.Draw(gameTime); break; case State.GameWindow: gameWindow.Draw(gameTime); break; case State.ShopMenu: shopMenu.Draw(gameTime); break; case State.FleetMenu: fleetMenu.Draw(gameTime); break; case State.CardsMenu: cardsMenu.Draw(gameTime); break; } if (tooltipToDraw != null) { tooltipToDraw.Draw(spriteBatch); } base.Draw(gameTime); Game1.self.spriteBatch.End(); if (popupToDraw != null) { Game1.self.spriteBatch.Begin(); popupToDraw.Draw(spriteBatch); Game1.self.spriteBatch.End(); } }