I'm using XNA and C#. I have two shapes (texture2ds), and I want to overlay shape 2 (50% transparent square) over shape 1 (opaque circle), but I want to get Option B, not Option A.
I basically want to render only the part of the square that's over the circle, without rendering the rest of the square over the background.
EDIT: Let me clarify why exactly I want to do this. I'm essentially using something like this as cheap shadows on top-down 2d planets. When a moon, planet, and sun are all in a 180 degree line, the moon is expected to be completely shaded. So I want to put a shadow behind the planet that won't cover the background, but when the moon passes under it, it gets shaded black.