Всем привет. Не знаю как правильнее задать вопрос. Тут кодик взял в сети.
Код AS3:
var lineSize:Number=40;
var drawnBitmapData:BitmapData = new BitmapData(210, 145, true, 0x00000000);
var drawnBitmap:Bitmap = new Bitmap(drawnBitmapData);
var erasableBitmapData:BitmapData = new BitmapData(210, 145, true, 0xFFFFFFFF);
var erasableBitmap:Bitmap = new Bitmap(erasableBitmapData);
erasableBitmap.cacheAsBitmap = true;
addChild(erasableBitmap);
maskee.cacheAsBitmap = true;
maskee.mask = erasableBitmap;
var eraserClip:Sprite = new Sprite();
initEraser();
function initEraser():void {
eraserClip.graphics.lineStyle(lineSize,0xff0000);
eraserClip.graphics.moveTo(stage.mouseX,stage.mouseY);
stage.addEventListener(MouseEvent.MOUSE_MOVE,maskMove);
}
function maskMove(e:MouseEvent):void {
// Draw a line to current mouse position
eraserClip.graphics.lineTo(stage.mouseX,stage.mouseY);
// Clear the drawn bitmap by filling it with a transparent color
drawnBitmapData.fillRect(drawnBitmapData.rect, 0x00000000);
// Copy our eraser drawing into the erasable bitmap
// (This is required to ensure the smooth alpha edges on our eraser are retained)
drawnBitmapData.draw(eraserClip , new Matrix(), null, BlendMode.NORMAL);
// Fill the erasable bitmap with a solid color
erasableBitmapData.fillRect(erasableBitmapData.rect, 0xFFFFFFFF);
// Copy the scribble bitmap to our main bitmap, with blendmode set to ERASE
// This erases the portion of the mask that has been drawn.
erasableBitmapData.draw(drawnBitmap, new Matrix(), null, BlendMode.ERASE);
}
function startDrawing(e:MouseEvent):void {
eraserClip.graphics.moveTo(stage.mouseX,stage.mouseY);
}
Вопрос таков, можно ли как то определить, отследить, любыми доступными способами,что обьект под маской виден полностью?
Спасибо.