[SOLVED] 'hide_windows' equivalent for screen action

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
famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

[SOLVED] 'hide_windows' equivalent for screen action

#1 Post by famakki1 »

Hi all,

I have been digging around the forums but haven't been able to find a decent solution

I want to know if there is an action to hide dialogue boxes using a button (both avg and nvl dialogue boxes). At the moment I am using:

config.keymap['hide_windows'] = [ 'mouseup_2', 'h', 'joy_hide','K_SPACE' ]

Which allows the keyboard to do this. But can I do this via a button in the quick menu? Thanks
Last edited by famakki1 on Wed Mar 29, 2017 8:23 pm, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: 'hide_windows' equivalent for screen action

#2 Post by indoneko »

We can do that, but why do you need to add it in the first place? :roll:

There are many ways to do that, but this is how I would do it.
First, modify the screen say by adding a checking variable, named "hiding", to switch between showing & hiding the say screen. If the hiding value is True, we hide the textbox.

Code: Select all

screen say(who, what):
    style_prefix "say"
    showif not hiding:  # ---> Here's the switch
        window:
            id "window"

            if who is not None:

                window:
                    style "namebox"
                    text who id "who"

            text what id "what"
Then add this at the end of screen quick_menu() :

Code: Select all

                textbutton _("Hide Textbox") action SetVariable("hiding", True)
                textbutton _("Show Textbox") action SetVariable("hiding", False)
Don't forget to set the default value to False at the beginning of your script.
My avatar is courtesy of Mellanthe

User avatar
Alex
Lemma-Class Veteran
Posts: 3094
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: 'hide_windows' equivalent for screen action

#3 Post by Alex »

Try something like this

Code: Select all

screen my_scr():
    textbutton "Press me!" action HideInterface() align (0.05, 0.05)
# The game starts here.
label start:
    "..."
    show screen my_scr
    "... ..."
    "?"
https://www.renpy.org/doc/html/screen_a ... eInterface

famakki1
Regular
Posts: 55
Joined: Wed Oct 12, 2016 7:40 am
Contact:

Re: [SOLVED] 'hide_windows' equivalent for screen action

#4 Post by famakki1 »

@indoneko , no particular reason but just wanted the user to have a button that he/she can use to view CG art during the game :)

@Alex @indoneko thanks for your help :)

Post Reply

Who is online

Users browsing this forum: Majestic-12 [Bot], MisterPinetree