How do I fade loop

Get help using Construct 2

Post » Tue Sep 15, 2015 1:56 pm

how to i make

when mouse clikc on object set opacity 100 - 20 and 20 - 80 like fade in fade out .. with loop infinity time

can be work with fade behavior ?
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Tue Sep 15, 2015 2:34 pm

Probably, but it's just as easy to do it through events. Give your object two instance variables (I'll call them "goforit" and "fade" for the heck of it).

Now it's a little unclear exactly what you're looking for, but it sounds like you want to activate a fading loop/psuedo-flash once you click on an object. I also presume you want to turn the behavior off. By default, both values will be 0.

On Click, set "goforit" to 1. You'll use this as a toggle to active/deactivate the effect

From there, you'll just compare the state of the object and change the opacity accordingly.

Here is an image showing the events to make this in a very flexible way:

Image

300 is the speed of the fade, the rest is state management.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Sep 15, 2015 4:16 pm

can you send capx plz?/ im confused with sub oO

im my game i spawn alot same object,,, how is stop and start when i click a new object?
B
17
S
7
G
7
Posts: 205
Reputation: 5,335

Post » Wed Sep 16, 2015 2:33 am

The capx would be a sprite, the mouse plugin, and then that exact event sheet. I screenshotted the entire thing. You might need to check out the manual or a tutorial on how sub-events and object-picking work--my capx wouldn't change anything with your understanding of those. If you're trying to affect multiple objects, you might need to look into "for each" loops as well.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Wed Sep 16, 2015 7:56 am

also look at the sine behaviour which has an opacity movement setting...
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,882

Post » Wed Sep 16, 2015 8:00 am

why dont u use sine behavior opacity? it automatically creates a looping fade out in u only need to change the period magnitude random starting .. if u need any ...random start... keep in mind ... if u set magnitude to 20 that means the higher the sine will go to 20 opacity and lower ... if u set 100 the magnitude the sine will go to 100 opacity and below
you only need to trigger that bolean u made into enabling and disabling the sine... and when its enabled add a sub condition trigger once set opacity to 100 or what is ur max visibility point u want ...

@RamPackWobble jinx ... didn't read ur comment before lol...
B
78
S
23
G
69
Posts: 1,353
Reputation: 43,985


Return to How do I....?

Who is online

Users browsing this forum: Apollo14 and 25 guests