How do I Fade In and Out a level?

Get help using Construct 2

Post » Sun Jun 11, 2017 6:56 pm

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:

https://www.youtube.com/watch?v=wdshXg6ZjfM

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.
B
5
Posts: 6
Reputation: 237

Post » Sun Jun 11, 2017 7:47 pm

@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
Image
B
20
S
10
G
10
Posts: 229
Reputation: 7,624

Post » Mon Jun 12, 2017 1:47 pm

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.
B
5
Posts: 6
Reputation: 237

Post » Mon Jun 12, 2017 3:32 pm

@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
Image
B
20
S
10
G
10
Posts: 229
Reputation: 7,624

Post » Mon Jun 12, 2017 3:57 pm

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.
Image ImageImage
B
168
S
50
G
164
Posts: 8,228
Reputation: 105,575

Post » Mon Jun 12, 2017 8:29 pm

@newt yeah Ashley emailed me and asked me to change it :D
Image
B
20
S
10
G
10
Posts: 229
Reputation: 7,624


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, vegapomme27 and 9 guests