Is it possible to mask a sprite with another sprite?

0 favourites
  • 6 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I'm trying to create a shade on objects of different shapes. Say you got blob 1, blob 2 etc. and I can pin a circular shade on it, but I won't the excess to be cut off and not shown. I pin it because I want the blob to rotate, but the 'angle' of the shade must remain the same, so it's set to pin to position only.

    I tried a few masking .capx but they all involve masking whole layers.

    So more like a clipping mask. Or is this not possible?



  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, perhaps I should clarify.. this is what I'm wanting to achieve in Construct 2:


  • You can do this with blend modes. Both sprites need to be on the same layer with "Force own texture" enabled.

    The "Ball" sprite should have a gradient from black or grey to transparent (not to white). Put the ball above the red sprite and set "Source atop" blend mode for it. See this demo:

  • Hey, thanks!

    That works great. I did notice however that when the sprites are overlapping eachother, the shadow is visible on the other sprite. And thus not cut off in that case.

    Is there a solution for this?

    Also, this might not be entirely related, but I also wanted to prevent overlapping when the sprites are created. Basically the sprites are randomly created from four sides (left right top bottom), sometimes they spawn in almost the same place, there are three sprites spawned each time from a side.

    I'm thinking using some sort of 'solid' or physics technique, but I think this will have unwanted effects. They're just simple bullets that always move exactly towards the center of the screen (as they're supposed to).

    Thanks again.

  • Do you mean when several red sprites are overlapping each other? I'm afraid you will need to keep each pair of sprites (red+shadow) on a separate layer.


    There may be an effect you can use instead, a gradient mask or something like that, see this post:


    Spawning without overlapping is one of the most popular questions here. Try searching the forum and you should find lots of examples. Here is one:

  • Yes, I meant when the red sprites were overlapping.

    OK, so I just used many layers and some global variables to call them on seperate layers. That works. Setting each layer to force own texture.

    I couldn't find that specific masking effect on that topic though.

    Thanks for your help!

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