Hiding the dialogue box when opening a screen

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.
Post Reply
Message
Author
User avatar
LilStevie
Newbie
Posts: 7
Joined: Sat Mar 28, 2015 11:54 pm
Contact:

Hiding the dialogue box when opening a screen

#1 Post by LilStevie »

I'm using the code from this tutorial (viewtopic.php?t=23071) to incorporate an inventory into my game. The system works well, though there's one issue I'm having at the moment. The following is the code for the Show Inventory button that displays the inventory interface:

Code: Select all

screen inventory_button:
    textbutton "Show Inventory" action [ Show("inventory_screen"), Hide("inventory_button")] align (.95,.04)
While this displays the inventory just fine, it also leaves the main dialogue box visible. I'd rather have it so that once the Show Inventory button is clicked, the dialogue will disappear until the user closes the inventory again. I've tried adding several variations of 'Hide(window)' to the action part of the Show Inventory button to fix this, but nothing I do seems to work. Is there a specific command I need to include that I don't know about?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Hiding the dialogue box when opening a screen

#2 Post by Remix »

The simplest way is probably by using ShowMenu rather than Show

textbutton "Show Inventory" action [ ShowMenu("inventory_screen") ] align (.95,.04)

Note though, that your 'Close Inventory Afterwards' button will want to use "action [ Usual Actions, Return() ] " in order to automatically bring back the dialogue once done.
Frameworks & Scriptlets:

User avatar
LilStevie
Newbie
Posts: 7
Joined: Sat Mar 28, 2015 11:54 pm
Contact:

Re: Hiding the dialogue box when opening a screen

#3 Post by LilStevie »

Works like a charm. Thank you!

Post Reply

Who is online

Users browsing this forum: No registered users