AS3绘制正方形模糊和渐变填充
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3绘制正方形模糊和渐变填充相关的知识,希望对你有一定的参考价值。
var squareDrawing:MovieClip = new MovieClip(); this.addChild(squareDrawing); squareDrawing.graphics.lineStyle(1, 0x000000, 1); var fillType:String = GradientType.RADIAL; var colors:Array = [0xFF0000, 0x0000FF]; var alphas:Array = [100, 100]; var matr:Matrix = new Matrix(); matr.createGradientBox(200, 100, 0, -50, 100); var spreadMethod:String = SpreadMethod.REFLECT; //REPEATE, PAD, OR REFLECT squareDrawing.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod); squareDrawing.graphics.drawRect (0, 0, 100, 300); squareDrawing.graphics.endFill(); squareDrawing.graphics.drawRoundRect(200, 0, 100, 300, 50); var blur:BlurFilter = new BlurFilter(); blur.blurX = 10; blur.blurY = 10; blur.quality = 1; var filterArray:Array = new Array(blur); squareDrawing.filters = filterArray; squareDrawing.x = 500; squareDrawing.y = 100;
以上是关于AS3绘制正方形模糊和渐变填充的主要内容,如果未能解决你的问题,请参考以下文章
ActionScript 3 AS3填充可用屏幕区域(正方形)