How do I Fade In and Out a level?

0 favourites
  • 6 posts
From the Asset Store
Unlock Levels, Worlds & skin plus add coins by watching ads
  • Hi,

    I trying to fade a game from black to clear using a sprite to cover the layout. There is a behavior to use on a sprite "Fade", which works well for fading-in, but there doesn't appear to be an option for it to reverse and fade-out sadly.

    I came across this tutorial on YouTube:

    Which uses a Function to change the sprites opacity. Again it works well at allowing a fade-in transition, but trying to reverse it the way it is suggested in the tutorial doesn't work. I'm probably missing something daft, but I'm not sure what it is.

    Obviously the fade-out is setting the opacity of the sprite that is covering the layout to gradually become more transparent, but I obviously don't get the method that is used in the tutorial very well.

    One other issue, least it may be is whether I should "Destroy" the sprite when it's not in use to save resources. It is large as it covers the entire level, but maybe because it is essentially invisible it doesn't matter? but I'm not sure how Construct 2 works in this area. I know how to destroy an object, but I'm not sure how to "re-enable" it when I require it - is it possible?

    Thanks, Jay.

  • JayH what I always do is have a layer named fade which is at the top and have a massive black block covering the whole layout and name it fadeblock (I know you wont be able to see your project but lock the layer and set the fade block invisible). Then add the fade behaviour to your fadeblock and then in the event sheet put on start of layout fade block set visible set fade out and start fade and then to fade to another layout put your trigger in this case on player touches finish line/flag fade block set fade to fade in start fade wait 1 sec go to layout 2

  • Hi Laurence,

    Thanks for your reply. I'm still a little unclear on the fade-out part. I don't have any issue with the Fade-in, just out.

    Any chance of a screenshot of your Event Sheet please?

    The Fade-out is being triggered for both death (and reload Layout), and to finish the level too as you mentioned.

    Thanks, Jay.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • JayH So basically What you do Is When you want to fade to out to your next layout or level add your event so player on collision with finish flag set your fade block to fade in and then you have a system wait 1.0 sec then say go to layout 2 and i presume you have a fade in event for that layout aswell

  • You can fade a layer if you set it to not transparent, and use something like lerp to set its opacity.

    Too bad we can't use behaviors on layers.

    Also I'm pretty sure LaurenceBedford's avatar is gonna get him in some trouble.

  • newt yeah Ashley emailed me and asked me to change it

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)