Ren'Py Problem with the game menus in Ren'Py

UncommonRole

Newbie
Jan 4, 2021
39
20
Hello, I'm sorry if this is a silly question, but I haven't been learning to program for long and I'm a bit lost.

The issue is that I'm preparing the classic in-game menu that will display the player's stats and mission information. The problem arises when exiting the menu because I can't get the game to return to the exact point where the player opened it.

It either goes back to the main menu or I hide the menu, and the game doesn't progress. How can I do this? I'm sure it's something very simple, but I don't know which script to use. Thank you very much, everyone :D
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,971
16,225
How can I do this?
It would have been better to know how you are doing it, in order to correct your errors. But, well, the most basic, and most used, way to achieve what you want to do is:

Python:
screen UI():
    textbutton "open":
        xpos 0 ypos 0
        action Show( "stats" )

screen stats():

    modal True

    [whatever you want as content]

    textbutton "close":
        xalign 1.0 yalign 1.0
        action Hide( "stats" )

init python:
    config.overlay_screens.append( "UI" )
 
  • Like
Reactions: UncommonRole

UncommonRole

Newbie
Jan 4, 2021
39
20
It would have been better to know how you are doing it, in order to correct your errors. But, well, the most basic, and most used, way to achieve what you want to do is:

Python:
screen UI():
    textbutton "open":
        xpos 0 ypos 0
        action Show( "stats" )

screen stats():

    modal True

    [whatever you want as content]

    textbutton "close":
        xalign 1.0 yalign 1.0
        action Hide( "stats" )

init python:
    config.overlay_screens.append( "UI" )
Thank you very much. It worked perfectly. I'll keep experimenting with more things, so don't be surprised if I ask something again. And once again, thank you very much.:D
 
Last edited: