Fade

0 favourites
  • 10 posts
  • ...me again. Short question: How do I prevent the initial FADE?

  • what do you mean?

    if you are using the fade behavior and don't want the initial fade-in, I guess putting the fade in time property to 0 should work.

    if you just want to trigger the fade behavior whenever you want... Hum the behavior isn't really complete on that side. But you can do it like that :

    Create a boolean instance variable for your sprite with the fade behavior. Let's call it fadeNow and put false as default value.

    And do something like that :

    Mouse: On Left button Clicked  
          -> Sprite: Set fadeNow to true
    Sprite: [invert] is fadeNow 
          -> Sprite: Fade: restart fade

    It will make the fade behavior constantly restart every tick so it will get stuck on step 1 until you click so the behavior can fade.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah Fade needs more control, particularly a Start Fade, Stop Fade.

  • Thanks Yann....

    ...this makes FADE not realy usefull....in my mind

  • yeah I usually fade stuff by event.

  • I'm feeling like the first person to know this behavior, hehe :D

    http://www.scirra.com/forum/behavior-gleam_topic46307.html

  • Good stuff. Fade is kinda weird but thx for the help. Gonna try and implement it.

  • If you want a "stop" function you can edit the behavior.

    Add this to the edit js.

    //////////////////////////////////////////////////////////////

    // Actions

    AddAction(0, 0, "Restart fade", "", "{my}: restart fade", "Run the fade again.", "RestartFade");

    AddAction(1, 0, "Start fade", "", "{my}: start fade", "Start the fade, if not active on start.", "StartFade");

    AddAction(2, 0, "Stop fade", "", "{my}: stop fade", "Stop the fade.", "StopFade");

    and this to the runtime.

         behinstProto.doStop = function ()

         {

              this.stage = 3;

              this.runtime.redraw = false;

         };

    //////////////////////////////////////

         Acts.prototype.StopFade = function ()

         {

              this.doStop();

         };

    You are basically saying, when Stop is called, trick it into thinking it is done. But don't reset anything.

  • 04 Dec 2011

    firebelly

  • 04 Dec 2011

    firebelly

    I know! :( Figured someday someone might want it.

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