Is it possible to use fade in frames?

Discussion and feedback on Construct 2

Post » Thu Sep 26, 2013 8:55 pm

I would like to change frames but I need to do this with fade, gradually. Is it possible? If yes, could anyone explain how to do this? Thanks.
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Fri Sep 27, 2013 12:51 am

you could create a tiled sprite with opacity 0
then gradually increase it's opacity
and when it reaches 100 change to another layout
B
12
S
3
G
1
Posts: 347
Reputation: 2,866

Post » Fri Sep 27, 2013 1:04 pm

Hi Ghost

Thanks for the answer.

My idea is to create a sprite with a gray image which when clicked changes the frame making the color image. The issue is that I wish it to happen gradually, so I thought to use fade. is it not possible then?
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Fri Sep 27, 2013 1:43 pm

There are two ways to do it (or maybe more, but I can only give hints to two):
1) Use a WebGL effect, like "Grayscale", on the colored image and start to fade the intensity to 0 using a variable and dt

2) Use two sprites, one having the colored frame, in front of it the one with the grey frame. Apply the fade behavior to the sprite in front, so that its opacity gradually changes to invisible.
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Fri Sep 27, 2013 6:02 pm

Thanks Tulamide. I'll try both.
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Fri Sep 27, 2013 7:54 pm

Could anyone give me an example of how to use dt to control the intensity of the grayscale effect? Thanks.
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139

Post » Fri Sep 27, 2013 9:52 pm


This fades within 5 seconds from grey to color.
20 * dt subtracts 20 per second and 20 * 5 = 100
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Sat Sep 28, 2013 1:01 pm

Thanks a lot, tulamide.
B
74
S
14
G
4
Posts: 1,018
Reputation: 8,139


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests