Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
screen preferences():
tag menu
modal True
add "gui/game_menu/prefs_bg.png"
add "gui/game_menu/game_menu.png"
What I want to implement is, for example, when you pressing the button and transition from main menu to game menu starts, title.png becomes a little smaller, element.png wipes to right and game_menu.png wipes from left.
How such a complex transition can be implemented? Maybe it would be easier to make everything in same screen?
Missing/forgetting a lot of simplest things and ask about them here.
K-PSZH wrote: ↑Sun Nov 27, 2022 4:09 am
What I want to implement is, for example, when you pressing the button and transition from main menu to game menu starts, title.png becomes a little smaller, element.png wipes to right and game_menu.png wipes from left.
How such a complex transition can be implemented? Maybe it would be easier to make everything in same screen?
Transitions are used for the whole screen/scene. If you want to move, change particular elements you can use transforms. Check this documentation page(Animation and Transformation Language).
You can use on show and on hide statements to trigger specific transform when changing screens. You can use if statements to check which transform to apply. Rough example for title.png
transform title_transform:
on show:
zoom 1.0
xalign 0.5
yalign 0.0
linear 1.0 zoom 0.5
screen preferences():
tag menu
add "gui/main_menu/title.png":
if some_condition_to_check_if_title_transform_is_needed:
at title_transform
It is not hard to write the transforms that you mentioned, the harder part is to trigger them only when you need them. You probably want a specific transform when player comes from game or game_menu. You can track it with some variable or maybe pass argument to the menu: