标签:
import flash.geom.Point; import flash.display.BitmapData; import flash.filters.DisplacementMapFilter; import flash.display.MovieClip; import flash.events.Event; /** * 创建湖面微波效果 */ function createWater(target:MovieClip):void { var count:int = 1; var point:Point = new Point(0,0); var bitmap:BitmapData = new BitmapData(target.width,target.height,false,0); var displ:DisplacementMapFilter = new DisplacementMapFilter(bitmap,point,10,2,10,15,"clamp"); var filter:Array = []; filter.push(displ); target.addEventListener(Event.ENTER_FRAME,onEnter); function onEnter(e:Event):void { var offset:Array = []; offset[0] = new Point(count,count/8); bitmap.perlinNoise(45,5,3,50,true,false,7,true,offset); displ.mapBitmap = bitmap; target.filters = filter; count++; } } createWater(mc);
[ActionScript 3.0] AS3.0 水面波纹效果
标签:
原文地址:http://www.cnblogs.com/frost-yen/p/5216986.html