AS3绘制正方形模糊和渐变填充

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3绘制正方形模糊和渐变填充相关的知识,希望对你有一定的参考价值。

  1. var squareDrawing:MovieClip = new MovieClip();
  2. this.addChild(squareDrawing);
  3.  
  4. squareDrawing.graphics.lineStyle(1, 0x000000, 1);
  5. var fillType:String = GradientType.RADIAL;
  6. var colors:Array = [0xFF0000, 0x0000FF];
  7. var alphas:Array = [100, 100];
  8. var ratios:Array = [0, 255];
  9. var matr:Matrix = new Matrix();
  10. matr.createGradientBox(200, 100, 0, -50, 100);
  11. var spreadMethod:String = SpreadMethod.REFLECT; //REPEATE, PAD, OR REFLECT
  12.  
  13. squareDrawing.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
  14.  
  15.  
  16. squareDrawing.graphics.drawRect (0, 0, 100, 300);
  17. squareDrawing.graphics.endFill();
  18. squareDrawing.graphics.drawRoundRect(200, 0, 100, 300, 50);
  19.  
  20. var blur:BlurFilter = new BlurFilter();
  21.  
  22. blur.blurX = 10;
  23. blur.blurY = 10;
  24. blur.quality = 1;
  25.  
  26. var filterArray:Array = new Array(blur);
  27. squareDrawing.filters = filterArray;
  28.  
  29.  
  30. squareDrawing.x = 500;
  31. squareDrawing.y = 100;

以上是关于AS3绘制正方形模糊和渐变填充的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 3 AS3填充可用屏幕区域(正方形)

AS3用正方形(居中)填充可用屏幕区域

canvas绘制

小学生蓝桥杯Python闯关 | 绘制正方形

蓝桥杯省赛真题02python正方形内切圆 青少年组蓝桥杯python编程省赛真题解析

Android studio中怎么将方形按钮设置成圆角以及渐变效果