I'm creating a puzzle
where a few long sprites (let's call them l1, l2, l3, and l4) are scrolled vertically
through a few small transparent windows
in an otherwise opaque image. (a single sprite called b1)
The problem is the long sprites are overlapping, so they show up in more than one window.
I can't solve the problem using Z-order, since there is always at least one sprite that is being covered by the others
no matter what the Z-order.
I've already created transparent sprites that mark the location of the windows. (lets call them t1, t2, t3 and t4)
I want only the part of the long sprite that is in the window to be visible,
hence I want only that part of the long sprite that is overlapping with the transparent window sprite
to be visible for each pair of sprites.
So I want l1 to be visible only were it is overlapping t1, not were it's overlapping t2, t3 or t4.
Same thing with l2 and t2, l3 and t3, etc.
(And no, I can not prevent l1 from overlapping t2, t3, or t4.)
How can I do this?
So far I've tried all combinations of blend modes, Z-orders, effects and whatnot I can think of and nothing is working.
I suppose I could break up l1, l2, etc. into several smaller sprites, pin them together, and hide each one once they are no longer overlapping t1, t2 etc. but it's a lot of work since they are very long sprites and there's a lot of overlap to avoid.
If only there was a blend mode like destination in but were the alfa in the image ontop actually made the underlying image go transparent instead of black....