claus/as3swf — Issue #14: little careless in com.codeazur.as3swf.data.filters.FilterDropShadow
Author: zongwan
Created: 2011-11-10 09:29:49+00:00
State: open

override public function parse(data:SWFData):void {
dropShadowColor = data.readRGBA();
blurX = data.readFIXED();
blurY = data.readFIXED();
angle = data.readFIXED() ; // → angle = data.readFIXED() * 180 /Math.PI;
distance = data.readFIXED();
strength = data.readFIXED8();
var flags:uint = data.readUI8();
innerShadow = ((flags & 0x80) != 0);
knockout = ((flags & 0x40) != 0);
compositeSource = ((flags & 0x20) != 0);
passes = flags & 0x1f;
}

effect: get filter can not get correct dropShadowFilter

override public function get filter():BitmapFilter {
return new DropShadowFilter(
distance,
angle, // need angle not radian
ColorUtils.rgb(dropShadowColor),
ColorUtils.alpha(dropShadowColor),
blurX,
blurY,
strength,
passes,
innerShadow,
knockout
);
}

thank you for the amazing project!

sorry for my bad english...

PS:如果你懂得中文...
以下为错误的中文简述:

在com.codeazur.as3swf.data.filters.FilterDropShadow类中

函数parse 读到的angle 是弧度值
在as3 中 DropShadowFilter 使用的是角度值
将angle 换算为角度值 才能得到正确的 BitmapFilter

filter包下的其他类 我没有尝试

感谢你 分享这么棒的 代码

以上问题 是我今天下载的 ZIP 中 遇到的