Revert fade effect?

0 favourites
From the Asset Store
Wind effect
$2.49 USD
Animated wind effect for objects, grass, trees, etc.
  • Hi there, I'm new to Construct and I'm trying to use the fade out behavior revealing the new rooms I enter, in a way that the room I was before fades to black. (So in a house with many rooms, the only one visible should be the one I'm in)

    So far I'm able to reveal the new room with the fade behavior, but my problem is with the other room... How can I make it turn to black slowly and fluidly (sort of a reversal fade effect) and not all of a sudden?

    I don't know if I'm being clear but thanks in advance!

  • Try this...

    [attachment=0:2rzgej6j][/attachment:2rzgej6j]

  • it says i can't open the file because i'm using the version 173 and it was made in a 175 version... But the 173 version is the last one isn't it?

    EDIT - I got it to work, thanks! But still, if I keep running quickly from one black area to another, right next to their borders, it kind of bugs...

    Sometimes the area I enter gets black, sometimes the area I leave gets visible... Isn't there a simpler way to do this?

  • This is not as easy as it seems. I finally got something going with LiteTween. It's a 3rd party plugin but you can do some amazing things with it, if you can work it out! I'm still not 100% sure why this works and lots of other variations I tried didn't..

    LiteTween is a behaviour so put it in the behaviours folder not plugins.

    [attachment=1:70003ead][/attachment:70003ead]

    [attachment=2:70003ead][/attachment:70003ead]

    For this I changed platform behaviour to 8-direction to navigate the 4 rooms. Just to demonstrate proof of concept.

    [attachment=0:70003ead][/attachment:70003ead]

  • Give this a go - I hope it's the kind of thing you're after. I removed the fade behavior from sprite4 and added a FadeIn and a FadeOut boolean. The booleans are set according to whether or not the player is overlapping the shade sprite, another event then takes care of the fade in or fade out effect, using dt to ensure a smooth fade effect....

    Edit - deleted the file because I was dumb - see below for a fully working example!

  • Give this a go - I hope it's the kind of thing you're after. I removed the fade behavior from sprite4 and added a FadeIn and a FadeOut boolean. The booleans are set according to whether or not the player is overlapping the shade sprite, another event then takes care of the fade in or fade out effect, using dt to ensure a smooth fade effect....

    The right-hand room never fades out?

  • thanks for the answers, I'm trying them out!

    the one from Colludium looks simpler, but yes, the right room doesn't fade... The events are only dealing with Sprite4, which is the one in the left

    Any way to make all the shadow sprites behave the same way with these events?

  • Simpler than 2 events? <img src="{SMILIES_PATH}/icon_e_geek.gif" alt=":geek:" title="Geek">

    Any way to make all the shadow sprites behave the same way with these events?

    My demos do, see above... First has 2 rooms, second has 4. Event sheet unchanged.

    If you don't have 176b

    https://www.scirra.com/construct2/releases/r176

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • thanks, codah, I'll try to apply this to the original game and come back to you

    edit - it doesn't seem to work in the original project. When I enter a new shadow area all shadows disappear... maybe I'm missing something...

  • Hm that's a shame.. Be sure you have the initial opacity values, etc. correct on your sprites. Use mine as an example. You could post your capx, or PM it to me.

  • See if this isn't more up your alley...

  • The right-hand room never fades out?

    Ahhh - I guess I was being dumb and didn't understand the OP... Try this updated version where both sides fade. I used another copy of the Sprite4 as there's no need to use 2 different objects for this purpose.

    I've put in 2 event groups that you can enable/disable. The first uses 2 events and no variables and is very simple to implement... The second is 'tidier' to my brain because it only demands the system lerp when fading is in process. Of note on option 1 I had to use a For Each loop - I don't understand why it wasn't detecting the lack of overlap without it...

  • I made an example, but then I noticed Colludium made it almost exactly the same

    Posting an image anyways

  • I made an example, but then I noticed Colludium made it almost exactly the same

    Posting an image anyways

    Go back a page, you'll notice they've both become virtually same as my earlier example (except I use LiteTween)

    Anyway this has been fun. I'll know what to do if this requirement comes up

  • codah yeah, but we are using "hardcore events", not "the easy way behaviors"

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