I've been scratching my head at this and I can't figure it out. I've been using C3 only a few days though. xD
This is the effect I'm going for:
Check out this demo:
Edit: sorry, didn't realize you need to show the part which is hidden behind an object.
This is a bit of an advanced trick, involving some z-order, blend modes, and layer shenanigans.
Here's a quick example I put together. It definitely doesn't cover all cases and breaks when you have more than two objects to deal with at the same time, but I don't have a solution off the top of my head for that. Someone else who has dealt with this before could probably offer a more elegant way to approach it.
Thanks for the help, oosyrag. I'm still trying to figure out exactly what you did in the project (doh my noobness) but I think I get the general idea.
Though I wish there was an easier way haha.
I updated it, it should work for overlapping objects now. Basically anything "in front" of the player sprite should get sent to the layer above, which has the "force own texture" property applied on it and allows for the silhouette object to use the "source in" blending mode, which means it will only appear when overlapping another opaque object below it on that layer.
Event 2 basically z-sorts everything by y position.
Event 3 handles moving objects that are below the player to layer 1 and back to layer 0 when they are above the player
Edit: Recommend utilizing the drawing canvas method below by dop, it is cleaner and less likely to run into unforeseen issues compared to moving objects between layers.
Develop games in your browser. Powerful, performant & highly capable.
You can use Drawing Canvas to create a shadow copy of the character (especially useful if the character is animated), or to create a mask object.
Here are two examples, based on oosyrag's demo:
like this ? eleanorjmorel.itch.io/test-sp-newstuff
Yes that’s the idea I’m going for. I’m not at my pc so I can’t test the examples y’all have made but I’ll be sure to test them.