[Solved] Textbox not hiding when I press "H"

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
filthsama
Newbie
Posts: 18
Joined: Tue Jan 05, 2021 4:11 am
Completed: 0
Projects: A dating sim with some Persona mechanics
Contact:

[Solved] Textbox not hiding when I press "H"

#1 Post by filthsama »

Hello! I have tinkered quite a bit with the textbox to animate it and do some fancy stuff, but now it just doesn't hide when I press "H". I figure it's something to do with tags or layers, but I'm a bit of a novice with that. Here is all the new code I have that deals with the textbox:

Code: Select all

def popup(layer='say_screen'):
        renpy.show_layer_at(at_list=[retract], layer='say_screen')
        renpy.pause(0.1)
        renpy.show_layer_at(at_list=[expand], layer='say_screen')

    def down(layer='say_screen'):
        renpy.show_layer_at(at_list=[retract], layer='say_screen')
        renpy.pause(0.1)

    def up(layer='say_screen'):
        renpy.show_layer_at(at_list=[expand], layer='say_screen')

    from functools import partial
    def char_updown(char, event_name, interact=True, **kwargs):
            if not interact:
                return

            if event_name == "begin" and char != store.speaking_char:
                renpy.show_layer_at(at_list=[retract], layer='say_screen')
                renpy.pause(0.1)
                renpy.show_layer_at(at_list=[expand], layer='say_screen')
                store.speaking_char = char
                voice_sustain()
All this code essentially does is animate the textbox to go up and down whenever a character changes. I'm guessing this bit of code has changed how the textbox and say_screen act, but I don't know how to fix it. The say_screen code in screens.rpy is untouched.
Last edited by filthsama on Wed Aug 04, 2021 9:06 pm, edited 1 time in total.

User avatar
PyTom
Ren'Py Creator
Posts: 16088
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: Textbox not hiding when I press "H"

#2 Post by PyTom »

You probably want something like:

Code: Select all

define config.context_clear_layers += [ 'say_screen']
To add your new layer to the list of layers cleared when entering a new context.
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
filthsama
Newbie
Posts: 18
Joined: Tue Jan 05, 2021 4:11 am
Completed: 0
Projects: A dating sim with some Persona mechanics
Contact:

Re: Textbox not hiding when I press "H"

#3 Post by filthsama »

Thank you very much! Works like a charm.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]