Drawing on specific layer only

S

Strakee

Guest
Right now I have a blood drawing mechanic that draws on a simple area surface. It works like this: An object is created and as it flies it draws itself repeatedly on the surface like a brush.

The goal is to make it not draw itself on the background. (The blue part in the image is a background layer. The gray area is a sprite in an Asset layer.)


Is it possible to make it somehow draw itself only when it is on a specific layer (or a designated area) ? Without thousands of different surfaces for every sprite I want it to paint it on?
Sort of like photoshop layers.
If you are working on a smaller object on a background and overstrike, the "brush" won't paint outside the boundary.
Would be really nice if it didn't paint transparent pixels as well. Like a mask on which ONLY it can call the draw function.

I can solve this by making everything an object and checking it's collision mask.
But is there a cleaner way? Maybe some sort of shader-stuff ?

Thanks
 

Attachments

Top