How do I make effects apply over time?

0 favourites
  • 4 posts
From the Asset Store
Time rewind like in "Braid". Choose objects that will be affected by time rewind
  • I want to have an effect to apply itself over time. So for example I want the screen to fully desaturate over 5 seconds or so and later trigger something so it does the reverse. How would I go about doing that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey Leaufai,

    The following might do what you're looking for.

    In your layout, place a layer above all your other layers.

    Add the "Adjust HSL Mask" effect to this layer. (You can click the layer in the layer panel and edit it's properties in the properties panel.)

    Set the layer's "Transparent" property to "No".

    You should now be able to post-process the entire game with the "Adjust HSL Mask" effect.

    To smoothly fade in an fade out the effect, create two number variables.



    We'll use these to control the effect's saturation parameter.

    In this example, I'll use functions as the triggers for starting and stopping the desaturation effect, but you could use anything you want.

    * On function "desatOn": Set "targetSatValue" to 100.

    * On function "desatOff": Set "targetSatValue" to 0.

    * Every tick, if followSatValue < targetSatValue: Add 1 to "followSatValue".

    * Every tick, if followSatValue > targetSatValue: Subtract 1 from "followSatValue".

    * Every tick: Set "Adjust HSL Mask" param 1 (the saturation) to "followSatValue".

    (Actions in italics.)

    When the function "desatOn" is called, the targetSatValue is set to 100, and the followSatValue will begin gradually counting up to the target. When the targetSatValue is set to 0, then followSatValue will count back down to the new target value.

    Hope that helps.

  • Leaufai This is actually pretty complicated to do. Check out the CAPX file that comes standard with the Construct 2 download under your example files.

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