How to hide window and character sprite simultaneously (in parallel)

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
komehara
Regular
Posts: 36
Joined: Fri Jan 31, 2020 10:08 pm
Projects: Spirit Link
Tumblr: hsandt
Deviantart: hsandt
Github: hsandt
itch: komehara
Contact:

How to hide window and character sprite simultaneously (in parallel)

#1 Post by komehara »

I found how to hide a window (in my case the NVL box) with dissolve:

Code: Select all

window hide dissolve
and also a character sprite:

Code: Select all

hide character with Dissolve(0.25)
I also know how to apply a transition like dissolve to multiple character sprites:

Code: Select all

hide character1
hide character2
with Dissolve(0.25)
However, I don't find a way to find two heterogeneous elements: the window and a character sprite, because they use different syntaxes. For instance:

Code: Select all

window hide
hide character
with Dissolve(0.25)
will hide the window instantly, then dissolve the character.

To take a simple case, let's assume I want both to dissolve with the same duration. How can I do this?

Is there a general way to run two things in parallel, similarly to the `parallel:` instruction in transform syntax?

For now I guess I'll just apply a full screen fade out and then instantly hide the window and sprite when over. This works because in this case I also want to fade out the BG anyway, but in other cases it wouldn't.

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1009
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: How to hide window and character sprite simultaneously (in parallel)

#2 Post by m_from_space »

komehara wrote: Mon Jan 29, 2024 1:50 pm To take a simple case, let's assume I want both to dissolve with the same duration. How can I do this?
You can use so called dict-transitions: https://www.renpy.org/doc/html/transiti ... ransitions
This way the transition doesn't wait before it advances.

Code: Select all

define nointerrupt = { "screens": Dissolve(3.0) }

label start:
    show eileen
    "Hello."
    window hide nointerrupt
    hide eileen with Dissolve(3.0)
    return
You could also apply them directly if necessary:

Code: Select all

    window hide { "screens": Dissolve(3.0) }

Post Reply

Who is online

Users browsing this forum: jeffster