//This region contains all HUD data #region HUD data void initializeHUD() { hud = new HUDComponent(this, GraphicsDevice); BaseTextType temp; temp = new BaseTextType("Score:", "Fonts/LindseySmall", new Vector2(10, 5), Color.Blue); hud.addText(temp); temp = new BaseTextType("Score Number", "Fonts/LindseySmall", new Vector2(55, 5), Color.Blue); temp = new NumberWrapper(temp, score); hud.addText(temp); temp = new BaseTextType("Lives:", "Fonts/LindseySmall", new Vector2(100, 5), Color.Blue); hud.addText(temp); temp = new BaseTextType("Lives Number", "Fonts/LindseySmall", new Vector2(145, 5), Color.Blue); temp = new NumberWrapper(temp, lives); hud.addText(temp); temp = new BaseTextType("Level:", "Fonts/LindseySmall", new Vector2(170, 5), Color.Blue); hud.addText(temp); temp = new BaseTextType("Level Number", "Fonts/LindseySmall", new Vector2(220, 5), Color.Blue); temp = new NumberWrapper(temp, levelNumber); hud.addText(temp); temp = new BaseTextType("Add Score Number", "Fonts/LindseySmall", new Vector2(60, 15), Color.Yellow); temp = new NumberWrapper(temp, 0); temp = new FloatWrapper(temp, new Vector2(0, 3), 1.0f); temp = new FadeWrapper(temp, 1.0f, -1); temp = new ScaleWrapper(temp, 1.02f, 1.0f, 1.0f); hud.addText(temp); Components.Add(hud); }
void initializeStaticText() { if (gameType.ScoreValue == ScoreValue.score) { hud.addText(new TextType("Fonts/Lindsey", "Level:", new Vector2(110, 410), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Score:", new Vector2(110, 430), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Bonus: x", new Vector2(190, 410), Color.Red, true)); } else if (gameType.ScoreValue == ScoreValue.time) { hud.addText(new TextType("Fonts/Lindsey", "Rows:", new Vector2(110, 410), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Score:", new Vector2(110, 430), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Bonus: x", new Vector2(190, 410), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Time:", new Vector2(110, 450), Color.Red, true)); } else { hud.addText(new TextType("Fonts/Lindsey", "Rows:", new Vector2(110, 410), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Score:", new Vector2(110, 430), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Bonus: x", new Vector2(190, 410), Color.Red, true)); hud.addText(new TextType("Fonts/Lindsey", "Time:", new Vector2(110, 450), Color.Red, true)); } }
//This region contains code for the HUD component, such as initializing and loading, as well as Event Handlers #region HUD Data void initializeHUD() { hud = new HUDComponent(this, GraphicsDevice); BaseTextType temp; temp = new TextType("Score", new Vector2(190, 90), Color.Red); hud.addText(temp); temp = new TextType("Score Number", new Vector2(190, 105), Color.Red); temp = new NumberWrapper(temp, score); hud.addText(temp); temp = new TextType("Level", new Vector2(190, 130), Color.Red); hud.addText(temp); temp = new TextType("Level Number", new Vector2(210, 145), Color.Red); temp = new NumberWrapper(temp, level); hud.addText(temp); temp = new TextType("Bonus", new Vector2(190, 170), Color.Red); hud.addText(temp); temp = new TextType("Multiplier Number", new Vector2(210, 185), Color.Red); temp = new NumberWrapper(temp, multiplier); hud.addText(temp); temp = new TextType("High\nScore", new Vector2(190, 210), Color.Red); hud.addText(temp); temp = new TextType("High Score Number", new Vector2(190, 245), Color.Red); temp = new NumberWrapper(temp, highScores.getHighScore()); hud.addText(temp); temp = new TextType("Next Level", new Vector2(25, 160), Color.White); temp = new FloatWrapper(temp, new Vector2(0, -3), 3.0f); hud.addText(temp); temp = new TextType("Next Level Number", new Vector2(90, 190), Color.White); temp = new NumberWrapper(temp, level); temp = new FloatWrapper(temp, new Vector2(0, -3), 3.0f); hud.addText(temp); temp = new TextType("Add Score Number", new Vector2(80, 240), Color.Yellow); temp = new NumberWrapper(temp, 0); temp = new FloatWrapper(temp, new Vector2(0, -3), 1.0f); hud.addText(temp); temp = new TextType("Multiplier Bonus", new Vector2(100, 100), Color.Orange); temp = new ScaleWrapper(temp, 1, 1.5f, 0.5f, 3); hud.addText(temp); temp = new TextType("Add Multiplier Number", new Vector2(100, 130), Color.Orange); temp = new NumberWrapper(temp, level); temp = new ScaleWrapper(temp, 1, 1.5f, 0.5f, 3); hud.addText(temp); temp = new TextType("Bonus Expired", new Vector2(25, 120), Color.Orange); temp = new FadeWrapper(temp, 4); hud.addText(temp); Components.Add(hud); }