AS3绘制API线条绘制和DropShadow

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3绘制API线条绘制和DropShadow相关的知识,希望对你有一定的参考价值。

Just some code that shows you how to set up the Drawing API and draw a line and also use the dropshadow filter.
  1. var lineDrawing:MovieClip = new MovieClip();
  2. this.addChild(lineDrawing);
  3.  
  4. lineDrawing.graphics.lineStyle(1);
  5. lineDrawing.graphics.moveTo(0,0); ///This is where we start drawing
  6. lineDrawing.graphics.lineTo(350, 600);
  7. lineDrawing.graphics.lineTo(600, 400);
  8.  
  9. var dropShadow:DropShadowFilter = new DropShadowFilter();
  10. dropShadow.color = 0x000000;
  11. dropShadow.blurX = 10;
  12. dropShadow.blurY = 10;
  13. dropShadow.angle = 0;
  14. dropShadow.alpha = 0.5;
  15. dropShadow.distance = 10;
  16.  
  17.  
  18. var filtersArray:Array = new Array(dropShadow);
  19. lineDrawing.filters = filtersArray;

以上是关于AS3绘制API线条绘制和DropShadow的主要内容,如果未能解决你的问题,请参考以下文章

AS3如何根据用户使用鼠标绘制线条的位置查找贝塞尔曲线的控制点

as3 绘制不规则图形

AS3曲线绘制API和Glow

在 AS3 图形 API 上应用 16 位颜色

如何在画布上动画绘制线条

Bresenham 的线条绘制算法