Can any one expain how to avoid seeing lines when using BlendMode.ERASE in AS3?
Here is an example. I draw a black background to the stage and then draw 2 overlaping circles to a sprite and try to erase them from the background.
var solidBitmapData = new BitmapData(550,400,true,0x000000);
var mySpriteLayer = new Sprite();
// Create black background.
mySpriteLayer.graphics.beginFill(0x000000);
mySpriteLayer.graphics.drawRect(0,0,550,400);
mySpriteLayer.graphics.endFill();
// Draw it to bitmap data.
solidBitmapData.draw(mySpriteLayer);
// Clear sprite.
mySpriteLayer.graphics.clear();
// Draw two circles
mySpriteLayer.graphics.beginFill(0xFF0000);
mySpriteLayer.graphics.drawCircle(200,200,50);
mySpriteLayer.graphics.endFill();
mySpriteLayer.graphics.beginFill(0xFF0000);
mySpriteLayer.graphics.drawCircle(250,200,50);
mySpriteLayer.graphics.endFill();
// Draw circles to bitmap with blend mode erase.
solidBitmapData.draw(mySpriteLayer,null,null,BlendMode.ERASE);
// Create bitmap and add to stage.
var solidBitmap = new Bitmap(solidBitmapData);
addChild(solidBitmap);
I'm talking about the lines in the middle of the circles. It seems to be something to do with linestyle but I've tried setting it to zero and the alpha to 0 but I can't get rid of the lines.
Any ideas?