public PausedState() : base() { _ControlManager = new ControlManagerComponent(this); SpriteFont font = CorvusGame.Instance.GlobalContent.Load<SpriteFont>("Fonts/MainMenuFont"); Image bg = new Image(CorvusGame.Instance.GlobalContent.Load<Texture2D>("Interface/PausedBackgroundalt")); bg.Size = new Vector2(UIHelper.Viewport.Width, UIHelper.Viewport.Height); _ControlManager.AddControl(bg); Label lblpaused = new Label(font); lblpaused.Text = "Paused"; lblpaused.Position = UIHelper.AlignControl(lblpaused.Size, HorizontalAlignment.Center, VerticalAlignment.Top)+ new Vector2(0, 20f); _ControlManager.AddControl(lblpaused); LinkButton continueBtn = new LinkButton(font); continueBtn.Text = "Continue"; continueBtn.Selected += continueBtn_Selected; continueBtn.Position = UIHelper.AlignControl(continueBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center); _ControlManager.AddControl(continueBtn); //LinkButton optionsBtn = new LinkButton(font); //optionsBtn.Text = "Options"; //optionsBtn.Selected += optionsBtn_Selected; //optionsBtn.Position = UIHelper.AlignControl(optionsBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 50f); ; //_ControlManager.AddControl(optionsBtn); LinkButton returnToMainMenuBtn = new LinkButton(font); returnToMainMenuBtn.Text = "Return to Main Menu"; returnToMainMenuBtn.Selected += returnToMainMenuBtn_Selected; returnToMainMenuBtn.Position = UIHelper.AlignControl(returnToMainMenuBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 50f); _ControlManager.AddControl(returnToMainMenuBtn); LinkButton exitGameBtn = new LinkButton(font); exitGameBtn.Text = "Exit Game"; exitGameBtn.Selected += exitGameBtn_Selected; exitGameBtn.Position = UIHelper.AlignControl(exitGameBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 100f); _ControlManager.AddControl(exitGameBtn); _ControlManager.SetFocus(); this.AddComponent(_ControlManager); }
public OptionsState() : base() { _ControlManager = new ControlManagerComponent(this); SpriteFont font = CorvusGame.Instance.GlobalContent.Load<SpriteFont>("Fonts/MainMenuFont"); Image bg = new Image(CorvusGame.Instance.GlobalContent.Load<Texture2D>("Interface/PausedBackgroundalt")); bg.Size = new Vector2(UIHelper.Viewport.Width, UIHelper.Viewport.Height); _ControlManager.AddControl(bg); LinkButton fullScreenBtn = new LinkButton(font); fullScreenBtn.Text = "Fullscreen: " + (audio ? "on" : "off"); fullScreenBtn.Selected += fullScreenBtn_Selected; fullScreenBtn.Position = UIHelper.AlignControl(fullScreenBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 50f); _ControlManager.AddControl(fullScreenBtn); LinkButton audioBtn = new LinkButton(font); audioBtn.Text = "Audio: " + (audio ? "on" : "off"); audioBtn.Selected += audioBtn_Selected; audioBtn.Position = UIHelper.AlignControl(audioBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 100f); _ControlManager.AddControl(audioBtn); LinkButton rumbleBtn = new LinkButton(font); rumbleBtn.Text = "Rumble: " + (rumble ? "on" : "off"); rumbleBtn.Selected += rumbleBtn_Selected; rumbleBtn.Position = UIHelper.AlignControl(rumbleBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 150f); _ControlManager.AddControl(rumbleBtn); LinkButton backBtn = new LinkButton(font); backBtn.Text = "Back"; backBtn.Selected += backBtn_Selected; backBtn.Position = UIHelper.AlignControl(backBtn.Size, HorizontalAlignment.Center, VerticalAlignment.Center) + new Vector2(0f, 200f); _ControlManager.AddControl(backBtn); _ControlManager.SetFocus(); this.AddComponent(_ControlManager); }