/// <summary> /// Constructor. /// </summary> public GameplayScreen(LevelManager lm) { TransitionOnTime = TimeSpan.FromSeconds(1.5); TransitionOffTime = TimeSpan.FromSeconds(0.5); pauseAction = new InputAction( new Buttons[] { Buttons.Start, Buttons.Back }, new Keys[] { Keys.Escape }, true); startAction = new InputAction( new Buttons[] { Buttons.A }, new Keys[] { Keys.Enter }, true); currentLevel = lm; }
/// <summary> /// Constructor lets the caller specify whether to include the standard /// "A=ok, B=cancel" usage text prompt. /// </summary> public MessageBoxScreen(string message, bool includeUsageText) { const string usageText = "\nA button, Space, Enter = ok" + "\nB button, Esc = cancel"; if (includeUsageText) this.message = message + usageText; else this.message = message; IsPopup = true; TransitionOnTime = TimeSpan.FromSeconds(0.2); TransitionOffTime = TimeSpan.FromSeconds(0.2); menuSelect = new InputAction( new Buttons[] { Buttons.A, Buttons.Start }, new Keys[] { Keys.Space, Keys.Enter }, true); menuCancel = new InputAction( new Buttons[] { Buttons.B, Buttons.Back }, new Keys[] { Keys.Escape, Keys.Back }, true); }
/// <summary> /// Constructor. /// </summary> public MenuScreen(string menuTitle) { this.menuTitle = menuTitle; TransitionOnTime = TimeSpan.FromSeconds(2); TransitionOffTime = TimeSpan.FromSeconds(0.5); menuUp = new InputAction( new Buttons[] { Buttons.DPadUp, Buttons.LeftThumbstickUp }, new Keys[] { Keys.Up }, true); menuDown = new InputAction( new Buttons[] { Buttons.DPadDown, Buttons.LeftThumbstickDown }, new Keys[] { Keys.Down }, true); menuSelect = new InputAction( new Buttons[] { Buttons.A, Buttons.Start }, new Keys[] { Keys.Enter, Keys.Space }, true); menuCancel = new InputAction( new Buttons[] { Buttons.B, Buttons.Back }, new Keys[] { Keys.Escape }, true); }
/// <summary> /// Adds the appropriate input to the corresponding user actions. /// </summary> public void InitializeActions() { upAction = new InputAction( new Buttons[] { Buttons.DPadUp, Buttons.LeftThumbstickUp }, new Keys[] { Keys.Up }, true); downAction = new InputAction( new Buttons[] { Buttons.DPadDown, Buttons.LeftThumbstickDown }, new Keys[] { Keys.Down }, true); selectAction = new InputAction( new Buttons[] { Buttons.A, Buttons.Start }, new Keys[] { Keys.Enter, Keys.Space }, true); pauseAction = new InputAction( new Buttons[] { Buttons.Start, Buttons.Back }, new Keys[] { Keys.Escape }, true); }