I have a based image and some sprites on top of the basd image movieclip… Some of the sprites can be drawn by the user using graphics api in actionscript 3. I can draw things on the sprites but I can’t create an eraser like brush that can remove part of the unwanted drawings. I try using Alpha but no it doesn’t work
I have googled about it and come up with the solution:
1) Linebitmapstyle… This solution is not the best one coz I my sprites can be moved so if I use linebitmapstyle, it does draw the pixel from the image to the sprite but if the sprite moved the drawn pixel won’t change.
2) Masking may not work for me either….
What is the best way of creating the eraser
You may rather want to use a Bitmap to make such things easier to manipulate (unless you need to do scalable vector graphics of course!). To draw shapes you can still use the graphics API to create the shapes.
To do so, instantiate a “dummy” sprite (or another
IBitmapDrawableimplementation) to create the graphics and then “copy” them to theBitmapDatathebitmapData.draw()function. This way you can for instance draw with the optionBlendMode.ERASEin order remove the pixels of the shape.Example (from the top of my mind) :