public override void LoadContent() { background = Game.Assets.Load <Texture2D>("spacebackground"); int xPos = (int)Game.GraphicsDevice.Viewport.Width / 5 * 3; int yPos = 70; //initialise the text's. this.showTimeScore = new ScoreText(this.Game, new Vector2(xPos, yPos), "TimeScore: " + this.totalTimeScore.ToString()); this.showBurnScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, HeightDifference), "BurnScore: " + this.totalBurnScore.ToString()); this.showCollectablesScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 2 * HeightDifference), "CollectablesScore: " + this.totalCollectableScore.ToString()); this.showPercentageBurned = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 4 * HeightDifference), "Percentage burned: " + this.percentageBurned.ToString()); this.showTotalScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 6 * HeightDifference), "TotalScore: " + this.totalScore.ToString()); //Add the scoreTexts to a list. this.texts = new List <ScoreText>(); this.texts.Add(this.showTimeScore); this.texts.Add(this.showBurnScore); this.texts.Add(this.showCollectablesScore); this.texts.Add(this.showPercentageBurned); this.texts.Add(this.showTotalScore); foreach (ScoreText text in this.texts) { text.LoadContent(); } xPos = 50; yPos = Game.GraphicsDevice.Viewport.Height - 190; this.font = this.Game.Assets.Load <SpriteFont>("font"); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Next Level", new Vector2(xPos, yPos), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Replay Previous Level", new Vector2(xPos, yPos + 30), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Quit to Main Menu", new Vector2(xPos, yPos + 60), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Quit Game", new Vector2(xPos, yPos + 90), this.font)); base.LoadContent(); }
public override void LoadContent() { background = Game.Assets.Load<Texture2D>("spacebackground"); int xPos = (int)Game.GraphicsDevice.Viewport.Width / 5 * 3; int yPos = 70; //initialise the text's. this.showTimeScore = new ScoreText(this.Game, new Vector2(xPos, yPos), "TimeScore: " + this.totalTimeScore.ToString()); this.showBurnScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, HeightDifference), "BurnScore: " + this.totalBurnScore.ToString()); this.showCollectablesScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 2 * HeightDifference), "CollectablesScore: " + this.totalCollectableScore.ToString()); this.showPercentageBurned = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 4 * HeightDifference), "Percentage burned: " + this.percentageBurned.ToString()); this.showTotalScore = new ScoreText(this.Game, new Vector2(xPos, yPos) + new Vector2(0, 6 * HeightDifference), "TotalScore: " + this.totalScore.ToString()); //Add the scoreTexts to a list. this.texts = new List<ScoreText>(); this.texts.Add(this.showTimeScore); this.texts.Add(this.showBurnScore); this.texts.Add(this.showCollectablesScore); this.texts.Add(this.showPercentageBurned); this.texts.Add(this.showTotalScore); foreach (ScoreText text in this.texts) { text.LoadContent(); } xPos = 50; yPos = Game.GraphicsDevice.Viewport.Height - 190; this.font = this.Game.Assets.Load<SpriteFont>("font"); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Next Level", new Vector2(xPos, yPos), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Replay Previous Level", new Vector2(xPos, yPos + 30), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Quit to Main Menu", new Vector2(xPos, yPos + 60), this.font)); this.entries.Add(new MenuEntry(this.Game, this.SpriteBatch, "Quit Game", new Vector2(xPos, yPos + 90), this.font)); base.LoadContent(); }