Godot Version
v4.2.2.stable.arch_linux
Question
From what I understand, Sprite2D’s clip children makes children only draw pixels that aren’t transparent in the parent sprite. How can I achieve an inverse effect, like if I was to invert the alpha value of all pixels of the mask (I guess this could be done with a shader but I have no idea how). Is there a better way to do masking if this isn’t viable?
Éither do a custom polygon2d to define the shape thats supposed to be clipped or use a shader or manipulate the sprite in code to inverse the alpha
my band-aid fix right now was using a big enough texture with the opposite pixels of my mask. I had managed to write a shader that inverted a Sprite2D’s alpha values for all pixels, but that shader did nothing when applied to the Light2D material
what exactly are you trying to achieve
making an area where sprite(or scene) A is visible while B is not. Everywhere outside the area would have A be invisible and B visible
What if a sprite in 3/4 of the way into the area? Do you want the part outside to behave differently than the part inside?
Or for it to be an all or nothing type scenario?
the part outside would behave differently
How is the area defined? What shape is it? A circle? A rectangle?
A circle (but in current impl it’s defined by a polygon that looks like one, the game is also pixel art)
So, there is probably a smarter way to do this, but I am not at my computer to play around.
But what if you just made two parent sprites to clip with that were the opposite of each other so they would clip opposite things?