[Solved]How do I hide part of an additive sprite with a mask

0 favourites
  • 8 posts
From the Asset Store
Smart UI Part 1 by Epic Stock Media is a one-of-a-kind collection of modern user interface sound effects.
  • Howdy fellow Constructeers !

    I'm having some trouble with blend modes...

    On my picture attached, the light sprite is in additive blend mode.

    Is there a way to hide only the light sprite with the black rectangle using blend modes ? I just want the part of the light that is overlapping the black shape to disappear while the rest stays the same... I have tried many things but I mostly end up with either only a black shape, or nothing at all (light sprite still visible).

    Thank you kindly for any clue !

  • Here's a .capx which will show the layers I have, the black shape on the layer LightMask corresponds to the zone the light is supposed to be invisible...

    I'm trying to hide only the layer "Light" where the light sprite overlaps the black one.

    Thank you by advance

  • Figured it out.

    In case someone needs the trick, I just had to turn the black rectangle into a totally empty sprite then put it in destination atop mode, on a superior z-order than the light, same layer.

    See the attached .capx

  • Nice

  • eli0s Oruzee

    Masking + Lighting system = ???

    If anyone can make it work I'm sure you guys can!

  • I'm guessing it can save a lot of memory if you're only masking sprites instead of casting rays or calculating shadows in real time.

    Just moving/resizing/changing angle of the mask already makes a pretty controllable shadow mask system without using too much CPU

  • E Bear I am having difficulties with blending modes. I am an After Effects user with no experience on Canvas2D or HTML5 so I don't really get all of these modes. I still try to wrap my mind around some of their basic functions. What I really wish for is a dedicated masking system that uses grayscale/opacity values (with the ability to invert the input values) for masking. And that should apply to any layer or sprite. I hope that it's technically feasible and that anytime soon Ashley will make it happen!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank You!

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