BitmapDataのエフェクトお試し2
/**
* Copyright gaziya ( http://wonderfl.net/user/gaziya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/pJZ7
*/
// forked from gaziya's BitmapDataのエフェクトお試し
package {
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.events.Event;
import flash.display.Shape;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
var canvas:BitmapData=new BitmapData(stage.stageWidth,stage.stageHeight,false)
addChild(new Bitmap(canvas))
var shape:Shape = new Shape
with (shape) {
graphics.beginFill(0x0)
graphics.drawCircle(100,0,10)
}
addEventListener(Event.ENTER_FRAME, loop)
var theta:Number = 0
function loop(e:Event):void {
canvas.colorTransform(canvas.rect, new ColorTransform (1,1,1,1,10,10,5))
var matrix:Matrix = new Matrix
matrix.rotate(theta)
matrix.translate(stage.stageWidth/2,stage.stageHeight/2)
canvas.draw(shape,matrix)
theta += 0.02*Math.PI
theta %= 2*Math.PI
}
}
}
}