Fade behaviour doesn't read updated opacity?

Discussion and feedback on Construct 2

Post » Sun Feb 17, 2013 8:31 pm

I'm not sure if this would be considered a bug.

I'm using the fade behaviour. When you first run the game, the plugin seems to run through all the sprites in the layout and get their opacity, setting "this.maxOpacity" to the current opacity.

This seems to have an odd side effect: If I set a sprite to opacity 50 in it's properties, maxOpacity is set to 50 on load and it fades out correctly. However if I set the opacity through an action then maxOpacity is already set to 100 on load, causing the fade behaviour to jump from 50 back to 100, then fade out.

Does this seem like a bug? I'm hesitant to report this if I'm just missing a step.
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Mon Feb 18, 2013 11:48 am

Sounds like it's working properly. If you issue the action while the fade is fading, the fade will override the opacity you set.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Mon Feb 18, 2013 4:51 pm

[QUOTE=Ashley] Sounds like it's working properly. If you issue the action while the fade is fading, the fade will override the opacity you set.[/QUOTE]

It's not so much that the fade is overwriting the fade, but that the fade is starting at the wrong opacity. If I do the following steps:

1) Create a sprite, add fade behaviour and set "Active at start" to false.
2) "On Spacebar down", set opacity to 50
3) Start fade.

Sample Capx

Instead of the sprite starting at 50 and moving down to 0, it goes back to 100 (the default opacity) and then starts fading to 0. The reason being that it's basing the start opacity on maxOpacity, which gets set when the layout starts (not the new opacity I set in the action).

B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Tue Feb 26, 2013 12:39 am

@Ashley : Any further thoughts after the post+sample above?
B
24
S
4
G
1
Posts: 244
Reputation: 3,462

Post » Tue Mar 05, 2013 9:08 am

Hi, I found your thread about the problem and wanted to demonstrate it again with another example:

Link to site

Fade opacity bug CAPX

I wanted to demonstrate also a workaround by using a while-wait pair... but suddenly it didn't work. Take a look into the capx. Maybe you could have a guess why.

B
11
S
3
G
3
Posts: 79
Reputation: 3,343


Return to Construct 2 General

Who is online

Users browsing this forum: AllanR, caad8user, Zebbi and 3 guests