Egret之渐变填充

怎甘沉沦 提交于 2020-01-11 21:02:34
        this.bgShape = new egret.Shape();
        this.bgShape.width = w;
        this.bgShape.height = h;
        let $max: egret.Matrix = this.bgShape.matrix;
        $max.a = $max.d = 0;
        $max.c = $max.b = 1;
        this.bgShape.graphics.beginGradientFill(egret.GradientType.LINEAR, [0xFF0000, 0xD7F0FC], [1.0, 1.0], [0, this.bgShape.height / 3], $max);
        this.bgShape.graphics.drawRoundRect(0, 0, this.bgShape.width, this.bgShape.height, 40, 40);
        this.bgShape.graphics.endFill();

结果:
Egret之渐变填充

注意 :
Egret之渐变填充

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!