Screen language
This page is part of the GenPy Ren'Py learning path. It focuses on practical Ren'Py 8.x production and links each concept back to the GenPy workflow.
Learning goals
- Declare screens and pass parameters.
- Use layout containers and displayables safely.
- Connect screen actions to story and UI state.
Core syntax
screentextbuttonvboxhboxactionuse
Runnable example
text
screen hello():
text "你好,世界!" xalign 0.5 yalign 0.1
textbutton "关闭" action Hide("hello") xalign 0.5 yalign 0.9Study outline
- Start with the smallest example for screen language.
- Test the key terms in a clean Ren'Py project: screen, textbutton, vbox, hbox.
- Move the pattern back into your real project only after the example runs.
- Use GenPy docs and validation to keep the feature connected to story, assets, and export readiness.
Common pitfalls
- Screen language is indentation-sensitive; keep nested layout blocks readable.
- Custom UI should be tested in the real Ren'Py runtime, not only in an editor preview.
- Test the smallest working script before layering on visual or UI complexity.
- Run Ren'Py Lint before release builds, even when the script appears to run locally.
- Keep examples in standard .rpy files so they remain editable outside GenPy.
Official references
- Ren'Py screen language reference: https://www.renpy.org/doc/html/screens.html
- Ren'Py official reference: https://www.renpy.org/doc/html/screen_actions.html
- Ren'Py official reference: https://www.renpy.org/doc/html/screen_special.html
How this fits in GenPy
- Use GenPy Screen Editor for visual UI planning, then inspect the generated or handwritten screen code in Code mode.
- Use Validation and export checks before relying on custom UI.
Recommended GenPy docs:
