# Pause Menu a full-screen modal overlay with stacked buttons, toggled by a key. ```{raw} html ▶ Run in browser ``` **Tags:** `ui` `menu` `pause` `modal` `anchors` A classic pause screen layered over the running game: pressing P (or ESC) drops a dimmed full-rect scrim across the whole viewport and pops a centred panel with Resume / Restart / Quit buttons stacked vertically. The scrim fills the screen via `AnchorPreset.FULL_RECT`, the panel sits dead-centre via `AnchorPreset.CENTER` with symmetric margins, and both stay correctly placed at any window size. The background keeps a simple animated marker so it is obvious the overlay sits on top of live content. ## What it demonstrates - A modal overlay built from a `FULL_RECT` scrim Panel plus a `CENTER`-anchored panel, both top-level Controls using anchors and margins, never absolute position. - Toggling the whole overlay's `visible` flag from a key press to show / hide. - A vertical `VBoxContainer` of `Button`s wired with `Button.pressed.connect()` (Resume hides the menu, Restart resets state, Quit closes the app). - The centred panel staying centred and the scrim staying full-screen on resize. Controls: P / ESC - Toggle the pause overlay Mouse - Click Resume / Restart / Quit ## Source ```{literalinclude} ../../examples/features/ui/pause_menu.py :language: python :linenos: ```