Sprites that "erase" their background to transparency?

I'm using SpriteKit for a drawing program and I'm working now on the eraser tool. One way is to implement an eraser is to simply draw with the background color, but I'd prefer to make the eraser change the alpha to 0 as it draws. That will work better when I add layers. I don't see a way to do this though. If I have a scene tree like:


- scene

- eraser strokes

- ...

- accumulated drawing

- background


As the eraser moves, the app adds sprites describing the eraser strokes, under the "eraser strokes" node. I'd like those to be blended down into "accumulated drawing" by lowering the alpha there and revealing "background".


Possible? Any suggestions?


thanks,

Rob

Replies

SKCropNode?

Thanks for the suggestion. I worked on it today and it is almost there. I think it will work, but I'm having some issues with the scene not updating when I flatten some eraser mark nodes into a single sprite node, within the mask node tree. That's another topic...