public Credits(SpriteFont font, StaticGraphic background, List <Vector2> vectorOffsets, List <string> messages) { m_background = background; m_font = font; m_centreOffsets = vectorOffsets; m_messages = messages; float minY = 99999; float maxY = -9999; for (int i = 0; i < m_centreOffsets.Count; i++) { if (m_centreOffsets[i].Y < minY) { minY = m_centreOffsets[i].Y; } if (m_centreOffsets[i].Y > maxY) { maxY = m_centreOffsets[i].Y; } } int height = (int)(maxY - minY); m_rect = new Rectangle(0, 1080, 1920, height + 100); m_position = new Vector2(960, 1700); m_creditsEnded = false; }
public ConstructionMenu(ContentManager content) { // Create general menu buttons and open menu m_backGround = new StaticGraphic(content.Load <Texture2D>("Art\\GameArt\\ConstructionMenu\\Background"), Vector2.Zero, Color.White); m_newTowerButton = new NormalButton(content.Load <Texture2D>("Art\\GameArt\\ConstructionMenu\\Buttons\\NewTower"), new Vector2(150, 50), Color.White, 1, 1, 1, 1, content, new ToolTip(content.Load <Texture2D>("Art\\GameArt\\ToolTipBacking"), Game1.debugFont, new Vector2(0, 0), Color.White, Color.Black, Vector2.Zero, "New Tower."), ""); m_dropMenu = new DropMenu(content, 292, 114, 216, 252, 400, 50, 50, 400, 150, "Art\\GameArt\\ConstructionMenu\\Buttons\\OpenTower"); m_saveButton = new NormalButton(content.Load <Texture2D>("Art\\GameArt\\ConstructionMenu\\Buttons\\SaveTower"), new Vector2(650, 50), Color.White, 1, 1, 1, 1, content, new ToolTip(content.Load <Texture2D>("Art\\GameArt\\ToolTipBacking"), Game1.debugFont, new Vector2(0, 0), Color.White, Color.Black, Vector2.Zero, "Save Tower."), ""); m_foundationCount = 0; m_rotorCount = 0; // Create the part menus and if necessary adjust the source rectangles m_partMenus = new List <DropMenu>(); // Create foundations menu CreateFoundationsMenu(content); // Create rotors menu CreateRotorMenu(content); // Create components/struts menu CreateComponentMenu(content); // Create weapons menu CreateWeaponsMenu(content); // Create utilities menu CreateUtilityMenu(content); // Finally create the back button m_backButton = new NormalButton(content.Load <Texture2D>("Art\\GameArt\\MenuGUI\\MapGenMenu\\GenButton0"), new Vector2(150, 1000), Color.White, 1, 1, 1, 1, content, new ToolTip(content.Load <Texture2D>("Art\\GameArt\\ToolTipBacking"), Game1.debugFont, new Vector2(0, 0), Color.White, Color.Black, Vector2.Zero, "Return to the level."), ""); // Create tower info and controls class m_construct = new TowerConstruct(content); m_tower = new Tower(content, new Vector2(126, 126)); m_openedIndex = 0; m_controls = new ConstructionControls(this); }