Java Reference
In-Depth Information
Listing 7.11
SolarFlare
class SolarFlare extends CustomNode {
public var centerX:Number;
public var centerY:Number;
public var angle: Number;
public var radiusX:Number = 6;
public var radiusY:Number = 10;
public override function create(): Node {
Group {
rotate: bind angle
content: [
Circle {
centerX: bind centerX
centerY: bind centerY
radius: 75
stroke: Color.TRANSPARENT
fill: Color.TRANSPARENT
},
Arc {
centerX: bind centerX - radius;
centerY: bind centerY;
radiusX: bind radiusX
radiusY: bind radiusY
startAngle: 90
length: 180
type: ArcType.OPEN
effect: GaussianBlur { radius: 6}
stroke: Color.YELLOW
fill: Color.TRANSPARENT
strokeWidth: 3
}
]
};
}
}
The next listing, Listing 7.12, shows the Totality class that contains six
SolarFlare s of various sizes rotated around the core disc of the Sun .
Listing 7.12
Totality
public class Totality extends CustomNode {
public var centerX:Number;
public var centerY:Number;
var radius:Number = 52;
 
Search WWH ::




Custom Search