Page 1 of 1

Transitions with an image inbetween?

Posted: Mon Nov 22, 2021 12:54 pm
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.

Re: Transitions with an image inbetween?

Posted: Tue Nov 23, 2021 3:55 am
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.

Re: Transitions with an image inbetween?

Posted: Wed Nov 24, 2021 2:00 am
by PyTom
You can probably use an ATL Transition for this:

viewtopic.php?t=14678