Layered images
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
- Represent character parts as reusable attributes.
- Use groups and conditions to avoid sprite duplication.
- Know when a layered image is simpler than many separate files.
Core syntax
layeredimageattributegroupalwaysif
Runnable example
text
define e = Character("艾琳", image="eileen")
e happy "开心!"
e sad "难过……"Study outline
- Start with the smallest example for layered images.
- Test the key terms in a clean Ren'Py project: layeredimage, attribute, group, always.
- 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
- 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 official reference: https://www.renpy.org/doc/html/layeredimage.html
How this fits in GenPy
- Use Assets to keep character parts organized.
- Use Performance Editor to stage expression and pose changes.
Recommended GenPy docs:
