[Solved] Hiding in-game-buttons when included in screen say

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
inahochama
Regular
Posts: 39
Joined: Tue Dec 15, 2009 12:38 am
Contact:

[Solved] Hiding in-game-buttons when included in screen say

#1 Post by inahochama »

I'm going bonkers trying to figure this one out for hours. I've basically added some textbuttons in my screen say so that these buttons will appear whenever the dialogue window appears, but when label credits starts, the window for the dialogue is gone but the textbuttons remain on screen.

I would like to know how I can make those textbuttons disappear with the dialogue window since window hide and hide screen say doesn't work.
Last edited by inahochama on Mon May 09, 2011 11:22 am, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: how to hide screendisplayable buttons under screen say ?

#2 Post by PyTom »

Can you take a screenshot of your game's credits, and also give the code for the credits?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
inahochama
Regular
Posts: 39
Joined: Tue Dec 15, 2009 12:38 am
Contact:

Re: how to hide screendisplayable buttons under screen say ?

#3 Post by inahochama »

This is the code for the label start and the label credits.

Code: Select all

label start:
    scene black
    with fade
    e "You've created a new Ren'Py game."
    e "text"
    e "text"
    jump credits
    
label credits:
    scene black
    with fade

    #window hide #(doesn't hide buttons)
    #hide screen say #(doesn't hide buttons)

    centered "text"
    centered "text"
    centered "text"
    
    return
This is the code for the in-game-menu-buttons in the screen say.

Code: Select all

screen say:

    # Defaults for side_image and two_window
    default side_image = None
    default two_window = False

    # Decide if we want to use the one-window or two-window varaint.
    if not two_window:

        # The one window variant.        
        window:
            id "window"

            has vbox:
                style "say_vbox"

            if who:
                text who id "who"

            text what id "what"

    else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:            
                window:
                    style "say_who_window"

                    text who:
                        id "who"
                        
            window:
                id "window"
                has vbox:
                    style "say_vbox"
                text what id "what"

    hbox xalign .98 yalign .98:
           textbutton "save" action ShowMenu("save")
           textbutton "options" action ShowMenu('preferences')
           textbutton "skip" action Skip() 
Attachments
This is how the label credits look like.
This is how the label credits look like.
Last edited by inahochama on Mon May 09, 2011 11:19 am, edited 2 times in total.

machinist
Regular
Posts: 179
Joined: Thu May 27, 2010 7:41 pm
Contact:

Re: how to hide screendisplayable buttons under screen say ?

#4 Post by machinist »

hmm try putting this at beginning of your credit label

$ show_button_game_menu = False

i used this to hide default buttons before

User avatar
inahochama
Regular
Posts: 39
Joined: Tue Dec 15, 2009 12:38 am
Contact:

Re: how to hide screendisplayable buttons under screen say ?

#5 Post by inahochama »

Thanks for the suggestion. Thing is that code only works if I had a show_button_game_menu as True or as an appended overlay but in the case of the code above, I don't. One of the reasons why I had these buttons added in my screen say is so I don't have to do any appending or true/false variables for in-game menu buttons. I was hoping to minimize typing :D


EDIT:

Turns out creating an "if" statement with showbuttons (or something) variable with the textbuttons in the screen say code, then setting it to "True/False" on the label start and label credits solved the issue. Hahaha, I practically had the answer all along thanks to Machinist's suggestion.

machinist
Regular
Posts: 179
Joined: Thu May 27, 2010 7:41 pm
Contact:

Re: [Solved] Hiding in-game-buttons when included in screen

#6 Post by machinist »

lol no idea how you figured it out but glad my comment helped xD

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]