Opacity-Switch of 2 Overlapping Objects w/Same Blend Effect

0 favourites
  • 2 posts
From the Asset Store
High quality sound effect pack, in the following categories: click, coin, damage, fail, jump, level up,message, shot
  • CAPX: https://www.dropbox.com/s/6noe9vfhze9da ... 41zm5.capx

    Summary: Two objects - HUDTimerLightGreen and Red - with the same characteristics but different colors are overlapping each other and a Spritefont object. One starts out with opacity 100 and the other 0. In accordance with the percentage of time remaining (variable Timer), the opacity inversely changes between the two objects. Both are set as "flashlights" (see the included Lighting capx example with C2) on the HUD with the Source In blend mode selected. The effect is to simulate a light shining behind the Spritefont object where the text is "cut out" and the light can be seen behind. As time counts down, the opacity of the red variant object increases while the green fades out.

    The image doesn't show the color effect I'm trying to describe, but is meant to display the backlit "cut out" effect I've set up.

    Number one problem: Because of the blend effect as one overlaps the other, one of the objects basically is forced to be black (or invisible...I'm not sure WHAT is going on). After some time passes, the other object does become visible...but as you can (not) see, the timer via the SpriteFont object is basically blacked out. (Adjust the Timer variable value to a shorter time if necessary.)

    I've examined the additional WebGL effects that you can apply to the objects, but I'm not yet sure if there is a viable alternative. Short of creating a frame-heavy animation altering the RBG value, I'm not sure how to remedy this.

    Any suggestions, please? Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • *bump*

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