zoukankan      html  css  js  c++  java
  • 利用BlendMode做镂空擦除效果

    import flash.display.BlendMode;
    import flash.events.MouseEvent;
    import flash.display.Shape;
    var bg:Sprite = new Sprite;
    bg.graphics.beginFill(0xffcc00);
    bg.graphics.drawRect(0, 0, this.stage.stageWidth, this.stage.stageHeight);
    bg.graphics.endFill();
    bg.blendMode = BlendMode.LAYER;
    this.addChild(bg);
    bg.addEventListener(MouseEvent.CLICK,onClick);
     
    //var child:Shape = new Shape;
    var box:Sprite = new Sprite;
    box.graphics.beginFill(0xffcc00);
    box.graphics.drawRect(100, 100, 200, 200);
    box.graphics.endFill();
    box.blendMode = BlendMode.ERASE;
    bg.addChild(box);
    box.addEventListener(MouseEvent.CLICK,onClickchild);
    function onClick(e:MouseEvent):void
    {
    trace("bg");
    }
    function onClickchild(e:MouseEvent):void
    {
    trace("box");
    }
  • 相关阅读:
    axios baseURL
    TP5 nginx 配置
    Vue
    key
    curl openssl error
    vue use bulma
    《平凡的世界》
    《听听那冷雨》余光中
    心烦意乱
    祝你19岁生日快乐
  • 原文地址:https://www.cnblogs.com/chenhongyu/p/3342057.html
Copyright © 2011-2022 走看看