• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Drawing on specific layer only

Strakee

Member
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