Background animation motionless until fade-in has finished

Started by PEd1, Sun 25/02/2024 13:39:21

Previous topic - Next topic

PEd1

So I have background animations and in "General Settings" I have "Default transition when changing rooms" set to "FadeOutAndIn"... (I am using the Tumbleweed template btw).

When my player enters the room, the animation is motionless during the fade-in (and any animations in the previous room are motionless during the fade-out of that room).

If I change the transition to "Instant" everything is moving right away...

Is there any way to have the FadeOutAndIn, but where the animations are already moving while the scene fades in?

Crimson Wizard

Default AGS transitions are blocking everything in the room, including background animations. Maybe this is not a particularly good design, but so it is right now.

If you like a different behavior, then make your own transition effect:
1. Set AGS transition to Instant.
2. Create a empty fullscreen GUI with black background.
3. In "before fade-in" event set GUI visible and Transparency 0.
4. In "after fade-in" event emulate fading effect changing GUI's Transparency from 0 to 100 in a loop, and remove it completely after with Visible = false.

Use "on_event" global function in GlobalScript instead of room events, this way you won't have to repeat same code in each room:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_event

Code: ags
function on_event(int event, int data)
{
    if (event == eEventEnterRoomBeforeFadein)
    {
        gFadeOut.Visible = true;
        gFadeOut.Transparency = 0;
    }
    else if (event == eEventEnterRoomAfterFadein )
    {
        while (gFadeOut.Transparency < 100)
        {
            // adjust numbers to change the fade-in speed
            gFadeOut.Transparency = gFadeOut.Transparency + 2;
            Wait(1);
        }
        gFadeOut.Visible = false;
    }
}

You may do opposite (fadeout) effect on eEventLeaveRoom event.

PEd1

Excellent, thanks!

Quote from: Crimson Wizard on Mon 26/02/2024 02:22:40Default AGS transitions are blocking everything in the room, including background animations. Maybe this is not a particularly good design, but so it is right now.

It's just a minor/subtle thing, and I think I'm noticing it more because I just added animations, so I'm very aware of them...
I think most players either don't notice, or they know it's the scene fading-in before everything is "live" in the room.

Though it's great to also have this option to alter it if necessary, thanks!

SMF spam blocked by CleanTalk