/// <summary> /// Deletes everything in this HUD display /// </summary> public void Destroy() { // Run derived removal this.OnDestroy(); // Run base removal if (this.iconLives != null) { this.iconLives.Reset(); this.iconLives = null; } ListNode itr = this.hudTextList.Head; while (itr != null) { // Reset itr.Reset(); // Remove and Next Node this.hudTextList.PopFront(); itr = this.hudTextList.Head; } this.RemoveDisposableHudText(); }
// // Methods // /// <summary> /// Initialize the layout and objects to display on the HUD /// </summary> public void Initialize() { // Create the lives icon this.iconLives = new HudIcon(IconLivesX, IconLivesY, Colors.Green, IconLivesSpacing, this.internalLives - 1, Sprite.Name.HUD_Player ); // Still Text HudText p1StillText = new HudText(LabelP1X, HighTextY, "SCORE< 1 >"); this.AddHudText(p1StillText); HudText highScoreStillText = new HudText(LabelHighscoreX, HighTextY, "HI-SCORE"); this.AddHudText(highScoreStillText); HudText p2StillText = new HudText(LabelP2X, HighTextY, "SCORE< 2 >"); this.AddHudText(p2StillText); HudText creditStillText = new HudText(CreditZeroX, LowTextY, "CREDIT 00"); this.AddHudText(creditStillText); // Updating Text this.textScoreP1 = new HudText(TextScoreP1X, MostlyHighTextY, this.internalScoreP1.ToString()); this.AddHudText(this.textScoreP1); this.textScoreP2 = new HudText(TextScoreP2X, MostlyHighTextY, this.internalScoreP2.ToString()); this.AddHudText(this.textScoreP2); this.textHighScore = new HudText(TextHighscoreX, MostlyHighTextY, this.internalHighscore.ToString()); this.AddHudText(this.textHighScore); this.textLives = new HudText(TextLivesX, LowTextY, this.internalLives.ToString()); this.AddHudText(this.textLives); // Additional initialization if requested by derived class this.OnInit(); }
/// <summary> /// Custom initialization routine. You must define how the /// HUD will look here. /// </summary> protected override void OnInit() { // Create the "Press Enter" text this.AddHudText(HudDisplayer.LabelPressEnterX, HudDisplayer.LabelPressEnterY, "Press Enter", Azul.AZUL_FONTS.Consolas24pt, Colors.Green); // Create the "Play" text this.AddHudText(LabelPlayX, LabelPlayY, "PLAY", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "Space Invaders" text this.AddHudText(LabelInvadersX, LabelInvadersY, "SPACE INVADERS", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "*Score Advance Table*" text this.AddHudText(LabelScoreX, LabelScoreY, "*SCORE ADVANCE TABLE*", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "=? Mystery" text this.AddHudText(LabelPointsX, LabelPointsY, "=? MYSTERY", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "=30 Points" text this.AddHudText(LabelPointsX, LabelPointsY - TableLineSpacing, "=30 POINTS", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "=20 Points" text this.AddHudText(LabelPointsX, LabelPointsY - TableLineSpacing * 2, "=20 POINTS", Azul.AZUL_FONTS.Consolas36pt, Colors.White); // Create the "=10 Points" text this.AddHudText(LabelPointsX, LabelPointsY - TableLineSpacing * 3, "=10 POINTS", Azul.AZUL_FONTS.Consolas36pt, Colors.Green); // Create the UFO icon this.iconUfo = new HudIcon(IconPointsX, LabelPointsY, Colors.White, 1.0f, 1, Sprite.Name.UFO); // Create the Squid icon this.iconSquid = new HudIcon(IconPointsX, LabelPointsY - TableLineSpacing, Colors.White, 1.0f, 1, Sprite.Name.AlienSquid); // Create the Crab icon this.iconCrab = new HudIcon(IconPointsX, LabelPointsY - TableLineSpacing * 2, Colors.White, 1.0f, 1, Sprite.Name.AlienCrab); // Create the Octopus icon this.iconOctopus = new HudIcon(IconPointsX, LabelPointsY - TableLineSpacing * 3, Colors.Green, 1.0f, 1, Sprite.Name.AlienOctopus); }