GameStateManagement.InputState.IsPauseGame C# (CSharp) Method

IsPauseGame() public method

Checks for a "pause the game" input action. The controllingPlayer parameter specifies which player to read input for. If this is null, it will accept input from any player.
public IsPauseGame ( ) : bool
return bool
        public bool IsPauseGame()
        {
            return IsNewKeyPress(Keys.Escape);
        }

Usage Example

Example #1
0
        public override void HandleInput(InputState input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            //Go back to the previous screen if the player presses the back button
            if (input.IsPauseGame(null))
            {
                Exit();
            }

            // Return to the main menu when a tap gesture is recognized
            if (input.Gestures.Count > 0)
            {
                GestureSample sample = input.Gestures[0];
                if (sample.GestureType == GestureType.Tap)
                {
                    Exit();

                    input.Gestures.Clear();
                }
            }
        }
All Usage Examples Of GameStateManagement.InputState::IsPauseGame