Suggestion - Reversed Fade Behaviour

0 favourites
  • 8 posts
  • Not complicated but useful, instead of using 2 different fade behaviours, why not make the fade behaviour reversible?

    Fadeout-Wait-Fadein.

  • You can achieve this result using the EaseTween or LiteTween behaviors, made by lunarray http://www.scirra.com/forum/behavior-litetween_topic53288_page1.html

  • Great, thanks!

  • You may want to learn to just skip it all together and just do it yourself so you can have more freedom. You can do it a number of ways--one of the easiest being make a private variable on the object you want to fade.

    If Object.Variable = 1    ----> set opacity to Object.Opacity+200*dt

    and Object.Opacity < 100

    (you can change the 200 to whatever you want).

    Then to fade out just set the variable to 0 and do:

    If Object.Variable = 0    ----> set opacity to Object.Opacity-200*dt

    and Object.Opacity > 0

    So I do like the two Tween plugins, but for simple fades just do it that way and save yourself the overhead. A single event for either direction takes care of everything.

  • +1

  • You may want to learn to just skip it all together and just do it yourself so you can have more freedom. You can do it a number of ways--one of the easiest being make a private variable on the object you want to fade.

    If Object.Variable = 1    ----> set opacity to Object.Opacity+200*dt

    and Object.Opacity < 100

    (you can change the 200 to whatever you want).

    Then to fade out just set the variable to 0 and do:

    If Object.Variable = 0    ----> set opacity to Object.Opacity-200*dt

    and Object.Opacity > 0

    So I do like the two Tween plugins, but for simple fades just do it that way and save yourself the overhead. A single event for either direction takes care of everything.Excellent!

    * Steals code and runs *

    C-7 is this better than the included Fade behavior??

  • > You may want to learn to just skip it all together and just do it yourself so you can have more freedom. You can do it a number of ways--one of the easiest being make a private variable on the object you want to fade.

    >

    > If Object.Variable = 1    ----> set opacity to Object.Opacity+200*dt

    > and Object.Opacity < 100

    >

    > (you can change the 200 to whatever you want).

    >

    > Then to fade out just set the variable to 0 and do:

    >

    > If Object.Variable = 0    ----> set opacity to Object.Opacity-200*dt

    > and Object.Opacity > 0

    >

    > So I do like the two Tween plugins, but for simple fades just do it that way and save yourself the overhead. A single event for either direction takes care of everything.Excellent!

    * Steals code and runs *

    C-7 is this better than the included Fade behavior??

    No clue, but it's super easy and you can use the same code for pretty much anything and make it framerate independent. Ie use Object.X instead to move. Your next step is to do similar stuff with lerp to make it look even better. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • C-7 thanks a lot bro,

    * feels awesome like superman *

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