Java Reference
In-Depth Information
Listing 7.8
Sun
public class Sun extends CustomNode {
public var centerX:Number;
public var centerY:Number;
public override function create(): Node {
return Group {
content: [
Circle { // Glare circle
centerX: bind centerX
centerY: bind centerY
radius: 70
opacity: 0.2
fill: Color.YELLOW
effect: GaussianBlur { radius: 10}
},
Circle { // Main Sun disc
centerX: bind centerX
centerY: bind centerY
radius: 52
fill: RadialGradient {
radius: 2
centerX: 0.5
centerY: 0.5
stops: [
Stop {
offset: 0.0
color: Color.WHITE
},
Stop {
offset: 0.3
color: Color.YELLOW
},
]
}
effect: GaussianBlur { radius: 10}
},
Circle { // Sun WHITE Center
centerX: bind centerX
centerY: bind centerY
radius: 15
fill: Color.WHITE
effect: GaussianBlur { radius: 10 }
},
]
};
}
}
 
Search WWH ::




Custom Search