BitmapDataのエフェクトお試し
♥0 |
Line 31 |
Modified 2011-11-21 20:55:24 |
MIT License
archived:2017-03-29 11:46:45
ActionScript3 source code
/**
* Copyright gaziya ( http://wonderfl.net/user/gaziya )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/9oJO
*/
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,0x0)
addChild(new Bitmap(canvas))
var shape:Shape = new Shape
with (shape) {
graphics.beginFill(0xffffff)
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 (0.9, 0.9, 0.9))
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
}
}
}
}