Flash inverted mask

后端 未结 2 1247
-上瘾入骨i
-上瘾入骨i 2021-01-13 19:41

I\'ve been looking for a simple way to invert a mask in flash. Its just amazing how it doesn\'t have this feature.

I just really need to paint shape and whatever is

2条回答
  •  醉梦人生
    2021-01-13 20:27

    To create an inverted mask in code do the following

    private function createInvertedMask(mcToBeMasked:MovieClip):void {
    
            mcToBeMasked.blendMode = BlendMode.LAYER;
            var invertedMask:Sprite = new Sprite();
            invertedMask.graphics.beginFill(0x0, 1);
            invertedMask.graphics.drawRect(640, 395, 630, 395);
            invertedMask.blendMode = BlendMode.ERASE;
            mcToBeMasked.addChild(invertedMask);
        }
    

    To create an inverted mask in the Flash Professional IDE Choose the properties panel of the image you want masked, select "Display" -> "Blending" -> "Layer" Then select your mask, and choose "Display -> "Blending" -> "Erase" You'll see something like this: enter image description here

提交回复
热议问题