How can I implement an eraser?

How can I implement an eraser?
0.0 0


Hello I am developing a simple paint app, but I don’t know how to make an eraser, I mean, something that when y make a CCNode::visit() instead of paint something erase it. The app have to support multilayer, so i was wondering if there is any way for implementing that, or something that can change the alpha of some part of a CCLayer.


Is there way to make eraser?

When enabling eraser just update blend functions of node

And when drawing enable update like this
_ccBlendFunc f =;

brush is the visit node used for drawing


Thank you very much, it works perfectly :slight_smile:


Is there any way we can found the erase percentage? I mean how much texture in term of percenetage still remaining ?