BlendMode.ADDのテスト
BlendMode.ADDのテスト
/**
* Copyright geko ( http://wonderfl.net/user/geko )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/DXhy
*/
//BlendMode.ADDのテスト
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
[SWF(backgroundColor="0x000000")]
public class FlashTest extends Sprite{
public function FlashTest() {
Wonderfl.capture_delay(5);
stage.addEventListener(MouseEvent.MOUSE_MOVE, drawCircle);
//ProjectNyaさんのコメントの通り
//背景を黒く塗ってみる
this.graphics.beginFill(0x000000);
this.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
this.graphics.endFill();
}
public function drawCircle(event:MouseEvent):void{
var circle:BlendModeTest = new BlendModeTest();
circle.x = mouseX;
circle.y = mouseY;
this.addChild(circle);
}
}
}
import flash.display.Sprite;
import flash.display.BlendMode;
import flash.filters.BlurFilter;
class BlendModeTest extends Sprite{
private var blur:BlurFilter = new BlurFilter(2,2,3);
public function BlendModeTest(color:uint = 0x000000){
if(color == 0x000000) color = Math.round(Math.random()*0xffffff);
this.graphics.lineStyle(5,color,0.8);
this.graphics.drawCircle(0,0,10+Math.round(Math.random()*20));
this.filters = [blur];
this.blendMode = BlendMode.ADD;
}
}