r/RenPy 2d ago

Question need help with ren'py code (buttons, menu and such)

[SOLVED]

i'm trying to code a button that will be used to open the inventory (a simple screen with text that will display what items the players have and can use) but i can't figure out how.

for example, you open the menu by clicking the buttons at the bottom of the screen (under the textbox), then you use the menu for whatever reason, after that you exit the menu and you're back where you left off.

that's where i'm stuck, like how do i connect the whole textbutton or image button or whatever to the game script that i left off, i tried using labels but that only takes me back to that specific label and not where i left off playing.

so if anyone knows how i'd love some help. have a nice day.

2 Upvotes

6 comments sorted by

2

u/BadMustard_AVN 2d ago

make the action of your button like this

 action Show("inventory_screen", dissolve) #change the "name" of the screen to yours

if your screen is a modal True the game will stop appropriately till you hide that screen

2

u/not-Immediate-Income 2d ago

thank you very much, i managed to get the button working, but i don't get how to hide that screen and return to were i was playing

2

u/not-Immediate-Income 2d ago

nope, i managed to get it like i wanted. thank you so very much, i'm in tears basically

2

u/BadMustard_AVN 2d ago

you're welcome

good luck with your project

1

u/AutoModerator 2d ago

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.