//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace ElementalGame { #region Using Statements using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; #endregion // In-game Screen public class GameScreen { // Attributes: protected GameMenu menu; // Menu object protected Texture2D backgroundTexture; // The background texture protected float backgroundAlpha = 1.0f; // Constructor public GameScreen() { } // Set the background texture public void SetBackground(Texture2D backgroundTexture) { this.backgroundTexture = backgroundTexture; backgroundAlpha = 1.0f; } public void SetBackground(Texture2D backgroundTexture, float alpha) { this.backgroundTexture = backgroundTexture; backgroundAlpha = alpha; } // Draw our game screen public void Draw(SpriteBatch spriteBatch) { // First draw the background texture if it is not null if (backgroundTexture != null) { spriteBatch.Draw(backgroundTexture, new Rectangle(0, 0, XML.SystemSettings.GAME_WINDOW_WIDTH, XML.SystemSettings.GAME_WINDOW_HEIGHT), new Color(255, 255, 255, (byte)(255 * backgroundAlpha))); } //now draw the menu elements menu.Draw(spriteBatch); } // Returns the menu public GameMenu GetMenu() { return menu; } } }