> For the complete documentation index, see [llms.txt](https://docs.flatredball.com/flatredball/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flatredball.com/flatredball/api/glue-runtime-api/glue-reference-screens-pausethisscreen.md).

# PauseThisScreen

### Introduction

The PauseThisScreen method is a method available to all Screens. The PauseThisScreen method calls [PauseEngine](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) and also sets the IsPaused property to true. This is a handy simple way to pause the game. To unpause the game, use [UnpauseThisScreen](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php).

### Code Example

The following code toggles pausing when the space key is pressed. It assumes that it is executed every frame (added to CustomActivity).

```
if(InputManager.Keyboard.KeyPushed(Microsoft.Xna.Framework.Input.Keys.Space))
{
    if(this.IsPaused)
    {
        UnpauseThisScreen();
    }
    else
    {
        PauseThisScreen();
    }
}
```

### PauseThisScreen pauses Entities

If a Screen is paused then all contained Entities will also be paused. This includes Entities that have been directly added through Glue, or Entities that belong to PositionedObjectLists that have been added through Glue. Paused Entities will not have Engine behavior applied (velocity), will not have CustomActivity called, and will not be clickable. Entities (and other objects) which are added to Screens can ignore pausing if their [IgnoresPausing](https://github.com/flatredball/FlatRedBallDocs/tree/main/frb/docs/index.php) property is set to true.

### PauseThisScreen and Screen CustomActivity

A Paused screen will still have its CustomActivity code called.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flatredball.com/flatredball/api/glue-runtime-api/glue-reference-screens-pausethisscreen.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
