How to hide the textbox and a sprite at the same time with a custom transition?

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
Forger Nova
Newbie
Posts: 8
Joined: Tue Aug 02, 2022 3:45 am
Contact:

How to hide the textbox and a sprite at the same time with a custom transition?

#1 Post by Forger Nova » Sun Aug 07, 2022 5:38 am

I have a custom transform that I'd like to apply in such a way that my textbox and side sprite slowly dissolve out at the same time. The problem is that "window hide" and "hide myimage" don't appear to work in the same way. I can use something like this with no problems:

Code: Select all

hide image1
hide image2
with dissolveslow
The transform I defined applies to both images and they are hidden at my custom dissolve speed at the same time.

But if I use this:

Code: Select all

hide player irritated
window hide
with dissolveslow
The default dissolve is applied to both instead of my custom dissolve. They do hide at the same time, but at the normal dissolve speed. I can apply the custom dissolve to either one separately without issue (using "hide player irritated with dissolveslow" and "window hide dissolveslow"), but of course that means they would hide in sequence instead of at the same time.

How would I go about getting both to hide simultaneously WITH my custom dissolve?

Here's my transition code, by the by:

Code: Select all

define dissolveslow = Dissolve(1.0, alpha=False)
SIDE NOTE: I'm not currently using the built-in "side image" feature because I could not figure out how to get my side sprites to appear and hide with dissolve.

User avatar
m_from_space
Veteran
Posts: 302
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How to hide the textbox and a sprite at the same time with a custom transition?

#2 Post by m_from_space » Sun Aug 07, 2022 3:15 pm

The solution I found while testing needs a "dict" transition and a configuration variable.
https://www.renpy.org/doc/html/transiti ... ransitions

If you always want the window to hide using that transition than alter the entry inside options.rpy, where it is defined (Renpy won't save changes to that variable, since it uses "define", but you can still alter it during the game).

Code: Select all

define slowdissolve = { "master" : Dissolve(2.0) }

label start:
    show myimage
    
    hide myimage
    with slowdissolve
    $ config.window_hide_transition = Dissolve(2.0)
    window auto hide

User avatar
Forger Nova
Newbie
Posts: 8
Joined: Tue Aug 02, 2022 3:45 am
Contact:

Re: How to hide the textbox and a sprite at the same time with a custom transition?

#3 Post by Forger Nova » Sun Aug 07, 2022 4:40 pm

m_from_space wrote:
Sun Aug 07, 2022 3:15 pm
The solution I found while testing needs a "dict" transition and a configuration variable.
https://www.renpy.org/doc/html/transiti ... ransitions

If you always want the window to hide using that transition than alter the entry inside options.rpy, where it is defined (Renpy won't save changes to that variable, since it uses "define", but you can still alter it during the game).

Code: Select all

define slowdissolve = { "master" : Dissolve(2.0) }

label start:
    show myimage
    
    hide myimage
    with slowdissolve
    $ config.window_hide_transition = Dissolve(2.0)
    window auto hide
Thanks for responding! I appreciate that you provided the relevant documentation link in addition to the code snippet. ^_^

This works nearly perfectly, but there is one small hiccup. With the version I was using previously, the text appears to hide at the same time as everything else. Now, the text visibly disappears before the window and sprite dissolve away. Do you know how I might fix this?

User avatar
m_from_space
Veteran
Posts: 302
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How to hide the textbox and a sprite at the same time with a custom transition?

#4 Post by m_from_space » Mon Aug 08, 2022 2:11 am

No, I don't know how to solve that, sorry.

User avatar
Forger Nova
Newbie
Posts: 8
Joined: Tue Aug 02, 2022 3:45 am
Contact:

Re: How to hide the textbox and a sprite at the same time with a custom transition?

#5 Post by Forger Nova » Mon Aug 08, 2022 2:48 am

m_from_space wrote:
Mon Aug 08, 2022 2:11 am
No, I don't know how to solve that, sorry.
No worries! I'm realizing belatedly that this is a general issue I have. I'd like to find a way to make the box, character name, and sprite all dissolve in/out at the same time in all instances, as opposed to just this one scene I was working on when I posted my question. I'll probably post another thread about that specific thing at some point!

Thanks again for your help. ^_^

Post Reply

Who is online

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