Hiding the dialogue window

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
m_from_space
Miko-Class Veteran
Posts: 957
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Hiding the dialogue window

#1 Post by m_from_space »

So I know that the player can hide the dialogue window via pressing "H" or middle mouse button and that this is defined via

Code: Select all

config.keymap['hide_windows'] = [ 'mouseup_2', 'h', 'noshift_K_h' ]
Now how can I make a button hide and show the dialogue screen in the same way without the game advancing and without creating a boolean inside the say screen?

What does not work and produces an error:

Code: Select all

button action Function(_window_hide)
What also does not work is just hiding the say screen, since when you show the say screen again it is expected to get a new line of dialogue of course.

I feel like I missed something here.

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

Re: Hiding the dialogue window

#2 Post by Alex »

The screen action is HideInterface() - https://www.renpy.org/doc/html/screen_a ... eInterface

User avatar
m_from_space
Miko-Class Veteran
Posts: 957
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Hiding the dialogue window

#3 Post by m_from_space »

Hey Alex,

thank you, but that's just the same as using Hide("say"), although it hides any other screen as well, which is not what I really want.

Also I would like to show the dialogue screen again. I guess i just create a boolean inside the say screen that I am going to toggle.

/edit
Well, that doesn't work, because when clicking the say screen throws an error then.

Is there a "ShowInterface" command too?

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

Re: Hiding the dialogue window

#4 Post by Alex »

m_from_space wrote: Thu May 19, 2022 7:13 am ...Is there a "ShowInterface" command too?
Just click somwhere to make screen appear...

Or try something like

Code: Select all

default say_window_show = True
    
screen say(who, what):
    
    style_prefix "say"

    window:
        if not say_window_show:
            xoffset config.screen_width
            # or
            # at fancy_transform_to_move_out
        #else:
            # at fancy_transform_to_move_in
            
        id "window"

        if who is not None:

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

        text what id "what"

Code: Select all

screen one_button_scr():
    textbutton "ClickMe!" action ToggleVariable("say_window_show", True, False) align(0.05, 0.05)

# The game starts here.
label start:
    show screen one_button_scr
    "..."
    "... ..."
    "?!"

User avatar
m_from_space
Miko-Class Veteran
Posts: 957
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Hiding the dialogue window

#5 Post by m_from_space »

Haha, yeah that was my idea too, just offset the screen and then create a button all over the window, but it's definitely ugly.

I'm just confused that it's not easier to hide it, since hitting the "H" key can easily show and hide it without advancing or clicking needed. Would need to know more about the inner workings of renpy I guess.

Thanks anyway!

Post Reply

Who is online

Users browsing this forum: Google [Bot]