• egret简单的刮刮乐效果


    private createGameScene1(): void {

    var bg = new egret.Shape();
    bg.graphics.beginFill(0x0000FF);
    bg.graphics.drawRect(0, 0, 480, 800);
    bg.graphics.endFill();
    this.addChild(bg);


    var container: egret.DisplayObjectContainer = new egret.DisplayObjectContainer();
    container.width = 300;
    container.height = 300;
    this.addChild(container);


    var shape: egret.Bitmap = new egret.Bitmap();
    shape.texture = RES.getRes("bg_jpg");
    shape.width = 480;
    shape.height = 800;
    container.addChild(shape);

    this.mask1 = new egret.Shape();
    container.addChild(this.mask1);
    shape.mask = this.mask1;

    this.touchEnabled = true;
    this.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.fill, this);
    }

    private fill(event: egret.TouchEvent) {
    this.mask1.graphics.beginFill(0x00FF00);
    this.mask1.graphics.drawCircle(event.stageX, event.stageY, 30);
    this.mask1.graphics.endFill();
    this.mask1.alpha = 0;
    // this.mask1.blendMode = egret.BlendMode.ERASE;
    }

  • 相关阅读:
    递归算法
    C#委托
    final 、finally
    JSP中的日期问题
    为GirdView添加CSS样式
    PC连Moto V180上网
    CSS条状图表:垂直型
    树型列表的实现
    关闭窗口无提示
    用PhotoShop做漂亮的相框,哈哈
  • 原文地址:https://www.cnblogs.com/jiajunjie/p/13678665.html
Copyright © 2020-2023  润新知