//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- namespace ElementalGame.GraphicUserInterface { #region Using Statements using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; #endregion using DarkWynterEngine.Globals; using DarkWynterEngine.UserInterface; using DarkWynterEngine.Menus; /// /// Used to select a map, or level. /// public class LevelSetup : GameScreen { /// /// GameMenu used by Level Setup to supply level selection options to user. /// /// public GameMenu displayMenu; /// /// Level setup constructor. /// public LevelSetup() { float scaleX = (Statics.SystemSettings.GAME_WINDOW_WIDTH / 1280.0f); float scaleY = (Statics.SystemSettings.GAME_WINDOW_HEIGHT / 1024.0f); // Instantiate the GameMenu displayMenu = new GameMenu("", 76 * scaleX, 38 * scaleY); displayMenu.SetDrawMenuTitle(false); displayMenu.AddImageScroller("", 4); menu = new GameMenu("", 520 * scaleX, 780 * scaleY); menu.AddLabel("Map:"); menu.AddLabel("Description goes here"); menu.GetMenuElement(1).SetFont(FontWriter.Arial); } /// /// Get the GameMenu used by LevelSetup. /// /// GameMenu specific to LevelSetup. public GameMenu GetDisplayMenu() { return displayMenu; } /// /// Gets the level selection scroller. /// /// Level selection scroller. public GameMenuImageScroller GetLevelSelection() { //float scaleX = (Statics.SystemSettings.GAME_WINDOW_WIDTH / 1280.0f); //float scaleY = (Statics.SystemSettings.GAME_WINDOW_HEIGHT / 1024.0f); //scroller.AddNewSlider("Selector bar", content.Load < Texture2D >("_textures/onSelectMS")); //scroller.AddNew("Earth", content.Load("_textures/GSEarthNeg"), null, (int)(76 * scaleX), (int)(38 * scaleY)); //scroller.AddNew("Fire", content.Load("_textures/GSFireNeg"), null, (int)(76 * scaleX), (int)(278 * scaleY)); //scroller.AddNew("Water", content.Load("_textures/GSAirNeg"), null, (int)(76 * scaleX), (int)(518 * scaleY)); //scroller.AddNew("Air", content.Load("_textures/GSWaterNeg"), null, (int)(76 * scaleX), (int)(758 * scaleY)); return ((GameMenuImageScroller)displayMenu.GetMenuElement(0)); } /// /// Returns the Name label for the currently selected map. /// /// Name label for the currently selected map. public GameMenuLabel GetMapNameLabel() { return ((GameMenuLabel)menu.GetMenuElement(0)); } /// /// Returns the Description label for the currently selected map. /// /// Description label for the currently selected map. public GameMenuLabel GetDescriptionLabel() { return ((GameMenuLabel)menu.GetMenuElement(1)); } /// /// Draw the Level Setup screen. /// /// SpriteBatch used to draw used to draw 2D. public override void Draw(SpriteBatch spriteBatch) { base.Draw(spriteBatch); displayMenu.Draw(spriteBatch); float scaleX = (Statics.SystemSettings.GAME_WINDOW_WIDTH / 1280.0f); float scaleY = (Statics.SystemSettings.GAME_WINDOW_HEIGHT / 1024.0f); //if (GetLevelSelection().GetActiveIndex() == 0) //{ // spriteBatch.Draw(select1, // new Rectangle((int)(60 * scaleX), (int)(36 * scaleY), (int)(248 * scaleX), (int)(201 * scaleY)), // new Color(255, 255, 255, (byte)(255 * backgroundAlpha))); //} //if (GetLevelSelection().GetActiveIndex() == 1) //{ // spriteBatch.Draw(select2, // new Rectangle((int)(60 * scaleX), (int)(268 * scaleY), (int)(248 * scaleX), (int)(201 * scaleY)), // new Color(255, 255, 255, (byte)(255 * backgroundAlpha))); //} //if (GetLevelSelection().GetActiveIndex() == 2) //{ // spriteBatch.Draw(select3, // new Rectangle((int)(60 * scaleX), (int)(512 * scaleY), (int)(248 * scaleX), (int)(201 * scaleY)), // new Color(255, 255, 255, (byte)(255 * backgroundAlpha))); //} //if (GetLevelSelection().GetActiveIndex() == 3) //{ // spriteBatch.Draw(select4, // new Rectangle((int)(60 * scaleX), (int)(754 * scaleY), (int)(248 * scaleX), (int)(201 * scaleY)), // new Color(255, 255, 255, (byte)(255 * backgroundAlpha))); //} } } }