Java Reference
In-Depth Information
The Moon is merely a black circle with a GaussianBlur effect to blend and
smooth the edges, as implemented in Listing 7.9.
Listing 7.9
Moon
public class Moon extends CustomNode {
public var centerX:Number;
public var centerY:Number;
public override function create(): Node {
Circle {
centerX: bind centerX
centerY: bind centerY
radius: 50
fill: Color.BLACK
effect: GaussianBlur { radius: 10 }
}
}
}
The SunBurst is an ellipse with a white fill, again using a GaussianBlur effect
to diffuse the color. This is illustrated in Listing 7.10.
Listing 7.10
SunBurst
public class SunBurst extends CustomNode {
public var centerX:Number;
public var centerY:Number;
public override function create(): Node {
Ellipse {
centerX: bind centerX
centerY: bind centerY
radiusX: 50
radiusY: 30
fill: Color.WHITE
effect: GaussianBlur{ radius: 30 }
rotate: 45
}
}
}
Totality is a set of solar flares rotating around the center point of the Sun out-
side of its main diameter. The SolarFlare is an Arc with a GaussianBlur effect
to diffuse the yellow color. Listing 7.11 shows the SolarFlare class.
 
Search WWH ::




Custom Search