[SOLVED] Hide textbox within function

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
Bren
Newbie
Posts: 18
Joined: Mon Aug 24, 2020 5:34 am
Completed: Game of Love
Contact:

[SOLVED] Hide textbox within function

#1 Post by Bren » Mon Aug 24, 2020 12:07 pm

Hi there,

I'm currently working on a very simple VN, and despite this, there are still a few things that appear to be a bit too hard for me...

Very basic question here: I want to zoom on specific parts of a given background for a few seconds, then resume the game with the normal-sized background. So far so good, but I can't find a way to hide the textbox during this process.

Code: Select all

image bg animated: 

    Solid("#000")

    zoom 2.0
    im.Scale("bg/room_day.png", 1280, 720)
    xalign 0.1 yalign 0.3
    pause 1.5
    Solid("#000")
    
    im.Scale("bg/room_day.png", 1280, 720) with dissolve
    xalign 0.6 yalign 0.3
    pause 1.5
    Solid("#000")
    
    zoom 1.0
    im.Scale("bg/room_day.png", 1280, 720) with dissolve
I've tried to use the command "window hide", but it doesn't seem to work within the image function. Does anyone know how to make this work?
Additional question: is there a way to add a variable to the image function so I can change the background anytime I call the function?

Many thanks!
Last edited by Bren on Thu Jul 08, 2021 7:35 am, edited 1 time in total.
Completed games - Game of Love

Image

User avatar
Bren
Newbie
Posts: 18
Joined: Mon Aug 24, 2020 5:34 am
Completed: Game of Love
Contact:

Re: Hide textbox within function

#2 Post by Bren » Thu Jul 08, 2021 7:34 am

Hey guys,

For those who would be interested, I kind of found a (messy) way to hide textbox for a few seconds while calling the function - to be put directly in your script where you want to textbox to be hidden:

Code: Select all

    $ preferences.skip_after_choices = False
    $ renpy.choice_for_skipping()
    $ _skipping = False
    $ quick_menu = False
    $ preferences.afm_enable = False
    show "CG/CG1.png"
    hide "CG/CG1.png"
    scene bg animated
    $ renpy.pause(6.0, hard=True)
    $ _skipping = True
    $ quick_menu = True
    $ preferences.skip_after_choices = True
I'm sure there's a better way to do this but at least it works. Hope this helps!
Completed games - Game of Love

Image

Post Reply

Who is online

Users browsing this forum: No registered users