Empty textbox shows up while using renpy.pause()

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
Adabelitoo
Regular
Posts: 86
Joined: Sat Apr 13, 2019 2:32 pm
Contact:

Empty textbox shows up while using renpy.pause()

#1 Post by Adabelitoo »

Some time ago I started working on a second game. I copy-pasted many things from my first game to my second game but something I noticed shortly after was that the textbox remained on screen during renpy.pause() while in my first game it hid automatically, and it hid automatically without the need of adding window hide before each renpy.pause(). The way I've been doing it so far is using the same image again but with a Dissolve, so instead of doing "$ renpy.pause(1.0)" I do "scene image001 with Dissolve(1.0)". As you can guess, that's a hassle.

Althought one difference between both games is that I went a little further with the say screen and changed/customized some things, mostly the position and width of the text. This is how it looks like:

Code: Select all

screen say(who, what):
    style_prefix "say"
    window:
        id "window"
        if who is not None:
            window:
                id "namebox"
                style "namebox"
                text who id "who"
        text what id "what"

    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0

## Make the namebox available for styling through the Character object.
init python:
    config.character_id_prefixes.append('namebox')

style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label

style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("gui/textbox.png", xalign=0.5, yalign=1.0)

style namebox:
    xpos gui.name_xpos
    xanchor gui.name_xalign
    xsize gui.namebox_width
    ypos gui.name_ypos
    ysize gui.namebox_height

    background Frame("gui/namebox.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
    padding gui.namebox_borders.padding

style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.5

style say_dialogue:
    properties gui.text_properties("dialogue")

    xalign gui.dialogue_xalign
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos

    adjust_spacing False

I don't know how important this is, but I know that Renpy discourages the use of Atom Editor because it can corrupt games, and I'm still using it because I'm already used to it and right now I don't have time to get used to a new editor so I planned to switch once I finished this project. If the text editor is the issue then I'll change right now. Thanks for reading.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Empty textbox shows up while using renpy.pause()

#2 Post by Imperf3kt »

Atom doesn't corrupt anything, the reason it is no longer suggested is because it's outdated.
PyTom wrote: Sun Oct 22, 2023 9:46 am I'd suggest switching to Visual Studio Code, as Atom is very obsolete.

The extension I use for VS Code is called "Code Spell Checker" https://marketplace.visualstudio.com/it ... ll-checker .

Once it's installed, you want to go to PReferences, then pick "Extensions", "Code Spell Checker", "Files, FOlders, and Workspaces", and under the "C Spell: Enable Filetypes" , click "Add Item" and add "renpy".
Of course, outdated does not mean that you cannot use it, just that newer methods are encouraged, I still use Atom just fine and prefer it. I don't need any fancy spell checker or other tools.


As to the issue with your textbox, you want to set the window config to "hide" (options.rpy)

Code: Select all

## Window management ###########################################################
##
## This controls when the dialogue window is displayed. If "show", it is always
## displayed. If "hide", it is only displayed when dialogue is present. If
## "auto", the window is hidden before scene statements and shown again once
## dialogue is displayed.
##
## After the game has started, this can be changed with the "window show",
## "window hide", and "window auto" statements.

define config.window = "hide"
Last edited by Imperf3kt on Sun Apr 14, 2024 1:54 am, edited 1 time in total.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Adabelitoo
Regular
Posts: 86
Joined: Sat Apr 13, 2019 2:32 pm
Contact:

Re: Empty textbox shows up while using renpy.pause()

#3 Post by Adabelitoo »

When choosing the text editor, Renpy adds under the Atom option "Atom is deprecated and its bugs are known for corrupting games, using another editor is recommended." I really don't want to change it so if Atom really doesn't corrupt games, that would be great for me.

About the windows issue, it doesn't work. It was in "auto", I changed it to hide, and it still doesn't work.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Empty textbox shows up while using renpy.pause()

#4 Post by Imperf3kt »

I wasn't aware Ren'Py said that when you tried to install Atom. I have never had an issue with it myself. YMMV I guess.

I don't know what to say about the window issue, I tested it my end before suggesting it, it works as intended for me.
Perhaps there is some other reason the window is not hiding.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2410
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Empty textbox shows up while using renpy.pause()

#5 Post by Ocelot »

Imperf3kt wrote: Sat Apr 13, 2024 6:31 am I wasn't aware Ren'Py said that when you tried to install Atom. I have never had an issue with it myself. YMMV I guess.
It is this problem. Quite a few people in Discord and several on forums complained the exact same thing happened to them.
https://github.com/atom/atom/issues/11406
< < insert Rick Cook quote here > >

User avatar
Adabelitoo
Regular
Posts: 86
Joined: Sat Apr 13, 2019 2:32 pm
Contact:

Re: Empty textbox shows up while using renpy.pause()

#6 Post by Adabelitoo »

viewtopic.php?t=46790

I went back to that older thread that I found before making this thread but I thought it wouldn't be useful to my, given how old it was and how it was fixed. I made a transpatent textbox like the guy said and it worked for me, so now my code is:

Code: Select all

screen say(who, what):
    style_prefix "say"
    window:
        id "window"
        if who is not None:
            window:
                id "namebox"
                style "namebox"
                text who id "who"
        else:
            background Image("gui/textbox0.png", xalign=0.5, yalign=1.0)
        text what id "what"
So what? The game thinks there is a who in my renpy.pause? Also, I couldn't make the "define _preferences.show_empty_window = False" work for me.

Edit: I kept testing it, and while it does fix the renpy.pause issue, it also uses the transparent textbox for the narrator, which makes sense now that I think about it. How can I fix it so it doesn't use the transparent textbox for the narrator?

Post Reply

Who is online

Users browsing this forum: No registered users