public override void LoadContent() { base.LoadContent(); Score.LoadContent(); Song = Content.Load <Song>("Music/gameover"); MediaPlayer.Play(Song); OkButton = new Button( new Texture("Sprites/Buttons/button"), new TextBlock("Fonts/GillSans_28", "OK"), new Vector2(Settings.ScreenCenter.X, Settings.ScreenCenter.Y + Score.Height + 30.0f) ); OkButton.Texture.Click += OkButton_Click; OkButton.LoadContent(); GameOverText = new TextBlock("Fonts/GillSans_48", "GAME OVER"); GameOverText.Position = new Vector2(Settings.ScreenCenter.X, Settings.ScreenCenter.Y - Score.Height - 20.0f); GameOverText.Color = Color.Gold; GameOverText.LoadContent(); Background = new Texture("Sprites/Backgrounds/background"); Background.Scale = new Vector2(0.8f); Background.Position = Settings.ScreenCenter; Background.LoadContent(); ScreenObjects.Add(Score); ScreenObjects.Add(Background); ScreenObjects.Add(GameOverText); ScreenObjects.Add(OkButton.Texture); ScreenObjects.Add(OkButton.Caption); }
public override void LoadContent() { base.LoadContent(); Song = Content.Load <Song>("Music/start"); MediaPlayer.Play(Song); PlayButton = new Button( new Texture("Sprites/Buttons/button"), new TextBlock("Fonts/GillSans_28", "PLAY"), Settings.ScreenCenter ); PlayButton.Texture.Click += PlayButton_Click; PlayButton.LoadContent(); Background = new Texture("Sprites/Backgrounds/background"); Background.Scale = new Vector2(0.8f); Background.Position = Settings.ScreenCenter; Background.LoadContent(); ScreenObjects.Add(Background); ScreenObjects.Add(PlayButton.Texture); ScreenObjects.Add(PlayButton.Caption); }