Fade one scene to another?

MLCinemaMLCinema Member Posts: 133
edited November -1 in Working with GS (Mac)
Hello All,

Is it possible to add a transition from one scene to another? Such as a fade.

Thank you again.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi MLCinema, there's possibly more than one way to do that, but in my case, for my Adventure Game i'm working on, I do the following:

    Actor with no image, called Blackout,the size being the size of the screen you're working with, made black.

    Another actor, "off-stage", (in each of your scenes) made an instance, with Rules: Spawn Blackout. Change attribute Blackout.Position.X (and Y) to suchandsuch. Interpolate Blackout.Colour.Alpha to 0 over how many seconds you want. this is the fade in. So in the Rules of the image Blackout put a Timer, after how many seconds, Destroy Actor.

    The fade out will be triggered by a button or when a variable is a certain value, presumably. If it's a button for instance, in that's Rules, put: Spawn Blackout Change Blackout.Colour.Alpha to 0. Change attribute Blackout.Position.X (and Y) to suchandsuch. Interpolate Blackout.Colour.Alpha to 1 over same amount of seconds as the fade in.

    The destroy blackout after so many seconds for the fade out might be more refined with a boolean attribute, so for instance, a button to go to another scene would be: go to Scene Whatever, change attribute game.FoutKill to true. In Blackout's rules, put when game.FoutKill is true, then destroy; setting the false at the beginning of the rules, if you see what I mean (top of the head stuff, this).

    Although there might be a more straightforward approach to this, it works for me! Hope it helps.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • juzcookjuzcook Member Posts: 259
    What gyro does is exactly what I've been doing in my game, works fine!
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Only thing is, juzcook, I've suddenly realised that you can't change the alpha of an actor that's been spawned; I'm sure you're doing it slightly differently, the way I'm doing it now:

    So MLCinema, forget my first post, this was what I tried first a while back and realised the problem that way.

    OK: game attribute (boolean) called FadeIn set to true
    Actor with no image, called Blackout,the size being the size of the screen you're working with, made black.
    in it's rules, put change attributes X & Y to centre of your screen. Rule: if FadeIn is true then Interpolate Alpha to 0 over 2 secs, change attributes X and Y to off-screen. That's the fade in.
    If FadeIn is false then change attributes X & Y to centre of your screen; interpolate Alpha to 1 over 2 secs.

    Place this onto every scene at the side of screen. (You could make it small and resize accordingly in it's Rules)

    In button, for instance, change attribute to false, Timer after 2 secs go to next scene.

    Think that's it this time!

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • MLCinemaMLCinema Member Posts: 133
    Wow! I am still new, but I plan on trying this asap. Thank you all.
  • chicopchicop Member Posts: 263
    you dont have to spawn it if alpha is set to 0.. you just interpolate the alpha to 1 amd put it in a top layer
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Hi chipoc; I'm sure you know, but for the record: it's not so much that you don't have to spawn to interpolate the fade-out, it's that you can't. To interpolate a fade-out from another actor on a spawned actor is not possible (as I remembered and wrote in my second post); unless the scene is a timed length of course, where you can put the fade out into a timer in the prototype's own rules.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.