How do I Fade properly? Maybe bug?

0 favourites
  • 7 posts
From the Asset Store
Match same tiles with each other as fast as you can and earn more score during a limited time!
  • Hey everybody!

    I have a problem with toggling the fade behaviour..

    If I fade out a sprite, everything goes well, but if I'm fading in, the stage of the fading changes from "Fade in", to "Fade out", and never goes to "Done".

    Any idea what am I doing wrong?

    Thank you!

  • Without seeing other events it's difficult to tell. I suspect the events from your screenshot are running on every tick, restarting the fade again and again. Put them inside the event where you change the state of "hide" variable.

  • Thanks for the reply!

    You're right, I didn't gave the whole scope for the issue. Here is a better view of the events:

    It doesn't run on every tick, just on a key pressed event. I checked, it runs only one time, and in the debug mode I cleary see, that the issue occurs only in "Fade in" mode. In that case, the fade is never reaching the "Done" phase. In "Fade out" mode, everything is fine.

    In the picture, I changed the Fade behaviour to Tween. In that way, it works perfectly.

  • I see I was wrong, sorry. It may be a bug, you can report it:

    github.com/Scirra/Construct-3-bugs/issues

  • Thank you, I think I will

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well just a guess here but when fading in it never reaches 'done' as that is tied to destroying after fading out, but fading out isn't happening because it's set to 0. Do you need it to be 'done' for any particular reason? There are separate conditions that trigger when fade in, wait, and fade out complete that you can use.

  • I realized, that I didn't wrote down the whole problem with that falsy state change :)

    So after fading in, I have that "Fade out" state, and not "Done". The problem with that, if I try to fade out the sprite again, it changes to "Done", and the image doesn't fade out, just changes its opacity to 0 immediately. I guess because there is a gap between states(?)

    I try to toggle this feature, so I never destory the sprite. On the first fading out, I get the "Done" state, and the sprite still exists, only the opacity value is 0. After fading in, I get this "Fade out" state, and after that, fading out always happen instantly.

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