blend mode for not overlapping alpha

N

NoFontNL

Guest
I draw 2 black rectangles with both alpha 0.5. They overlap, I don't want them to merge into each other so that the overlapping part is darker. Is there a blend mode for that?

Thanks in advance.
 
N

NoFontNL

Guest
It seems a bit unclear to me. See, the 2 rectangles are shadows behind 2 objects. (Drawing the sprite of the object with an offset behind the object itself in black color with alpha 0.5)
How would I do this? I've worked little with surfaces. If I first draw the application surface and then the surface of the shadows, the shadows will be ON TOP of the actual sprites, drawing them behind the application surface will not show them at all.
 

obscene

Member
You may need to have another object that draws before your objects which has the sole responsibility of drawing the shadows, or do it with a script assigned to a layer.

Example in a top down game:
1. Draw the ground
2. Draw the shadows
3. Draw your objects
 
Top