How do I add fade in and out transitions?

Sorry if this has an obvious answer, I just haven’t found the blocks/examples. How do you transition from scene to scene with a fade animation?

Currently when I have multiple scenes I use a state type machine (I hate fancy titles for things, it’s just a big if check):

switch (currentState) {
  case States.Menu:
    Menu.init()
    break;
  case States.Game:
    Game.init()
    break;
.. etc etc
}

When a scene is complete I call back to this and set the new State to whatever needs to be next (example: Push A on Menu, it callsback and this top level code will say “ok now make the state be Game”).

How does everyone transition this type of switch using fade out? Mine just flips to the next scene.

Sorry this isn’t in blocks, I assume there’s a lot fo large if/else blocks that people use to manage what the current scene is, so same-ish question using large if/else blocks.

1 Like

if you specifically want to fade in/out, you should check out the color fading extension which has functions for doing just that.

for more complex transition effects, you can try using my arcade-screen-transitions extension, though it requires a bit more work because you have to manage all the sprites from both scenes simultaneously for the duration of the transition.

2 Likes

Thanks, I KNEW there was an extension just terrible at searching :slight_smile:

3 Likes

@UnsignedArduino add this in Awsome arcade

1 Like

Already there! (I think it’s actually been there for a while now… :thinking: but who remembers :person_shrugging: )