Build a Reusable Modal Menu Screen in Ren'Py
Use Ren'Py screen language with modal True and textbutton actions to build a menu that blocks input and jumps to labels safely.
06 Oct 2026, 11:29 UTC

The useful answer
To show a menu over your game that blocks clicks behind it and sends the player to a label or exits cleanly, define a Ren'Py screen with modal True and open it from a label with call screen. Keep dialogue out of the screen; screens handle layout and input, while labels handle story text.
This pattern assumes a standard Ren'Py 7.x or 8.x project where the screen language is available by default. Screen names share a global namespace, so choose a unique name unless you intend to replace an existing screen.
How the mechanism works
The screen statement declares a reusable UI layer evaluated by Ren'Py's interface engine. Layout containers such as vbox stack widgets vertically, and textbutton creates a button whose action parameter runs when clicked. Built-in actions include Jump, which targets a label by string name, and Quit, which exits the game.
modal True stops mouse and touch input from reaching screens or game layers beneath the menu. zorder 100 places the screen above the default game layer. When you use call screen name(), Ren'Py displays the screen and pauses execution there until the screen is dismissed by an action such as Return or Jump.
Worked configuration
Place this screen definition in a file inside your project's game/ directory, such as game/screens/menu.rpy:
screen main_menu():
modal True
zorder 100
vbox:
xalign 0.5
yalign 0.5
spacing 20
textbutton "Start Game" action Jump("start")
textbutton "Load Game" action ShowMenu("load")
textbutton "Quit Game" action Quit(confirm=True)
xalign 0.5 and yalign 0.5 center the box on screen. spacing 20 adds 20 pixels between buttons. Quit(confirm=True) shows a confirmation dialog before closing the game.
Call the screen from a label so the game pauses while the menu is open:
label start:
call screen main_menu
"Welcome back."
scene bg room
show eileen happy
eileen "The menu is closed and the story continues."
Launch the project from the Ren'Py Launcher by selecting your project and clicking Launch Project. On Linux or macOS, you can also run the project from its directory with ./renpy.sh or renpy.sh, depending on the wrapper. No special permissions are required beyond read access to the project folder. If you rename the Jump target to a label that does not exist, Ren'Py raises an error only when the button is clicked, not when the game starts.
call screen versus show screen
| Statement | Pauses execution | Typical use |
|---|---|---|
call screen main_menu() | Yes | Modal menus that block the game until dismissed |
show screen main_menu | No | HUDs or overlays that sit behind ongoing gameplay |
Use call screen for this menu because you want input blocked and execution paused while the player chooses an option.
Limits and common mistakes
- No dialogue in screens.
sayandmenustatements are invalid screen language. If you need text, call a label from a button action and put thesaythere. - Missing
modal True. Without it, clicks pass through to the game or underlying screen, which can trigger unintended interactions. - Late label errors.
action Jump("missing_label")does not fail at startup. The error appears only when a player clicks the button, so missing labels can reach a built release. - Global screen names. Redefining a screen with the same name replaces the previous definition everywhere. Redefining built-in screens such as
main_menuorsavecan break launcher integration and rollback. - Store variables only. Variables used in screens must exist in the store, typically through
defaultor assignment in aninit pythonblock. Bare Python locals are not automatically visible.
Verification checklist
- Launch the project and reach the label that calls the screen. Confirm the menu appears above the game layer without console errors.
- Click "Start Game" and confirm the game jumps to the
startlabel. - Click "Quit Game" and confirm a confirmation dialog appears before the game closes.
- Temporarily remove
modal True, launch the project, and verify that clicks pass through to the layer beneath. Restoremodal Trueto confirm click blocking returns. - Rename the
Jumptarget to a nonexistent label, click the button, and confirm Ren'Py reports the missing label at click time. - Open
logsor the console after opening the screen and check forNameErrorif you reference store variables.
Practical check
After restoring modal True, open the menu and click an empty area of the screen outside the buttons. The menu should remain open and no game interaction should occur behind it. If the game advances or a hidden button activates, modal True is missing or another screen layer is intercepting input.