Transitions with an image inbetween?

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
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Transitions with an image inbetween?

#1 Post by Kinmoku »

Hi all,

I want to create a transition where A goes to B via an animated image. The animation is:

Code: Select all

image overlay:
    "transparent" # shows A here
    .2
    "overlay1.png"
    .2
    "overlay2.png"
    .2
    Solid("#FFFFFF") # shows B here
    1.0
    "overlay2.png"
    .2
    "overlay1.png"
    .2
    "transparent"
However, I am struggling with doing this for screens. Most transitions use ATL effects or dissolve/ fade, but here the screen will change behind an overlayed image. In essence, there is no "transition" as such. It's like a curtain being pulled over a stage to reveal a new stage afterward. I don't think it's too complicated, but I've tried to add it to screen buttons and it doesn't work:

Code: Select all

image overlay_on:
    "transparent"
    .2
    "overlay1.png"
    .2
    "overlay2.png"
    .2
    Solid("#FFFFFF")
    
image overlay_off:
    Solid("#FFFFFF")
    .5
    "overlay2.png"
    .2
    "overlay1.png"
    .2
    "transparent"
In screens:

Code: Select all

            button:
                style "mm_button"
                text _("New Game") style "mm_button_text"
                action [Show("overlay_startup"), Start()]
                
                # etc

screen overlay_startup():
    zorder 1000
    add "overlay_on"
    timer 2.0 action Hide("overlay_startup")
Then, when the game starts:

Code: Select all

label start:
    scene irl chapter1bg
    show overlay_off
    
    pause 2
    
But it doesn't work correctly :( I'd really like to make overlay_startup into a transition but I don't think there is a way to do that with an image, right?
Thanks in advance.

User avatar
Kinmoku
Miko-Class Veteran
Posts: 591
Joined: Mon Aug 11, 2014 9:39 am
Completed: One Night Stand
Projects: VIDEOVERSE
Tumblr: gamesbykinmoku
itch: kinmoku
Location: Germany
Contact:

Re: Transitions with an image inbetween?

#2 Post by Kinmoku »

I found a way for it to work. Since I wanted the transition to happen when starting a new game, I made a mock up of the game menu and added it to the start label:

Code: Select all

label start:
    show screen not_main_menu
    with dissolve

    pause 1.1

    scene white
    
    pause 0.1

    scene irl chapter1bg
    show overlay_off
In screens:

Code: Select all

screen not_main_menu():
    tag menu
    style_prefix "main_menu"
    add gui.main_menu_background
    timer .1 action Show("overlay_startup")
    
screen overlay_startup():
    zorder 1000
    add "overlay_on"
    timer 2.0 action [Hide("not_main_menu"), Hide("overlay_startup")]
    
    
The downside is not_main_menu is basically just "main_menu_background", as the player can start game from any menu screen, but it still looks pretty nice. Though, I'm still interested if anyone knows of a more elegant solution.

User avatar
PyTom
Ren'Py Creator
Posts: 16093
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: Transitions with an image inbetween?

#3 Post by PyTom »

You can probably use an ATL Transition for this:

viewtopic.php?t=14678
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

Post Reply

Who is online

Users browsing this forum: No registered users