Fade

Get help using Construct 2

Post » Sun Dec 04, 2011 2:00 pm

...me again. Short question: How do I prevent the initial FADE?
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Sun Dec 04, 2011 11:01 pm

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 :
[code]Mouse: On Left button Clicked
      -> Sprite: Set fadeNow to true
Sprite: [invert] is fadeNow
      -> Sprite: Fade: restart fade[/code]
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.

B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Dec 05, 2011 1:22 am

Yeah Fade needs more control, particularly a Start Fade, Stop Fade.
B
58
S
13
G
10
Posts: 632
Reputation: 12,505

Post » Mon Dec 05, 2011 9:19 am

Thanks Yann....

...this makes FADE not realy usefull....in my mind
B
42
S
19
G
12
Posts: 723
Reputation: 13,911

Post » Mon Dec 05, 2011 10:01 am

yeah I usually fade stuff by event.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Mon Dec 05, 2011 10:34 am

I'm feeling like the first person to know this behavior, hehe :D
http://www.scirra.com/forum/behavior-gleam_topic46307.html
B
34
S
8
G
5
Posts: 174
Reputation: 5,791

Post » Wed Mar 21, 2012 7:39 pm

Good stuff. Fade is kinda weird but thx for the help. Gonna try and implement it.
B
22
S
5
G
3
Posts: 194
Reputation: 5,855

Post » Tue Apr 30, 2013 2:23 am

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.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Tue Apr 30, 2013 2:25 am

[QUOTE] 04 Dec 2011 [/QUOTE]

@firebellyWhiteclaws2013-04-30 02:26:02
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Tue Apr 30, 2013 2:30 am

[QUOTE=Whiteclaws] [QUOTE] 04 Dec 2011 [/QUOTE]

@firebelly[/QUOTE]

I know! :( Figured someday someone might want it.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Next

Return to How do I....?

Who is online

Users browsing this forum: spacedoubt and 3 guests