How do I Get Something to Fade in not out?

Get help using Construct 2

Post » Sun Apr 20, 2014 5:29 pm

How do I Get Something to Fade in not out?
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Sun Apr 20, 2014 5:34 pm

Just use the fade behavior
https://www.scirra.com/manual/95/fade
There is an event that when fade finish you can tell it to restart
B
23
S
4
G
2
Posts: 364
Reputation: 2,392

Post » Sun Apr 20, 2014 5:37 pm

I think if you set Fade Out to 0 and set the time for Fade In in the Fade behavior properties that would do the trick.
B
19
S
7
Posts: 161
Reputation: 1,751

Post » Sun Apr 20, 2014 6:01 pm

@PhoenixNightly and @Vallar: What you guys told me worked but not exactly the way I wanted it to. I am trying to let a transparent background fade in over the game so it looks like the game dimmed but when it fades in the object loses its transparency so it just covers up the game. I tried setting the opacity to like 50 and I changed the alpha of the color to 135 but it still fades in as a solid color.
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Sun Apr 20, 2014 10:16 pm

Is this transparent background a Sprite Object or a layer with its Opacity turned on?

Either way you can set a variable to check if the BG should fade or not and if yes, add to its opacity a value multiplied by dt.

On the Sprite object it should look like this:

isFading---> set Sprite Opacity to self.Opacity + (a value) * dt

This will gradually add (a value) to the spite's opacity until it it reaches 100 (it' cant go any higher).

The same applies if the opacity values that you want to alter are on a opaque layer, the difference is that you'll get the layer's opacity actions on the system actions.

If you can clarify what is it that you want to fade I can make you an example capx...
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Apr 21, 2014 1:26 am

@eli0s The background is just a sprite
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Mon Apr 21, 2014 2:29 am

Ok, have a look at this example capx and tell me if this is what you're after.

http://www.eli0s.com/Tests/FadingSprite.capx
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829

Post » Mon Apr 21, 2014 2:37 am

@eli0s Thank you! Very helpful :D
B
37
S
14
G
3
Posts: 263
Reputation: 4,270

Post » Mon Apr 21, 2014 3:00 am

:)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
26
G
5
Posts: 1,146
Reputation: 9,829


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 27 guests