2
* This file is part of the dis-Emi-A HaXe Library. Copyright © edA-qa mort-ora-y
3
* For full copyright and license information please refer to doc/license.txt.
13
PARAM(color,T_RGB(1,1,1))
14
PARAM(opacity,T_Float(0.5))
15
PARAM(radius,T_RANDF(0.25+-0.2))
16
PARAM(size,T_RANDF(0.25+-0.2))
17
PARAM(speed,T_RANDF(4...6))
19
VAR(lights,Array<Light>,new Array<Light>())
22
for( i in 0...params.num )
30
Random.s_nextFloat(-0.5, 0.5),
31
Random.s_nextFloat(-0.5, 0.5)
33
l.r = Point2.at( params.radius.next(), params.radius.next() );
34
l.ang = Random.s_nextFloat( 0, 2 * Math.PI );
35
l.speed = params.speed.next();
36
l.size = params.size.next();
38
if( Random.s_nextBool() )
39
l.speed = -l.speed; //change the light's direction
42
l.sprite.graphics.beginFill( params.color.asInt(), params.opacity );
43
l.sprite.graphics.drawCircle( -1, -1, 2 );
47
TRAIT(Mode,Normal,DEFAULT)
51
SEQUENCE(Circle,DEFAULT)
57
l.ang += elapsed * l.speed;
66
l.sprite.x = (Math.cos( l.ang ) * l.r.x + l.ctr.x ) * actorSize.x;
67
l.sprite.y = (Math.sin( l.ang ) * l.r.y + l.ctr.y ) * actorSize.y;
75
l.sprite.width = l.size * actorSize.x;
76
l.sprite.height = l.size * actorSize.y;
84
public var sprite : flash.display.Sprite;
85
public var ctr : Point2; //center of the circle
86
public var r : Point2; //radius of the ellipse
87
public var ang : Float; //current angle of the light
88
public var speed : Float;
89
public var size : Float;
93
sprite = new flash.display.Sprite();
94
sprite.cacheAsBitmap = true;