Java Reference
In-Depth Information
Figure 8-4. Animated radial gradient
Listing 8-9 shows how this is implemented.
Listing 8-9. simpleRadial
function simpleRadial():Void{
delete group.content;
var colorValue = 0.0;
var rect = Rectangle{
translateX: 640/2-100
translateY: 480/2-100
width: 200
height: 200
fill: bind createRadialGradient(0.5,0.5,[
createStop(animateColor(colorValue, colorValue, 0, 1.0), 0.0),
Stop{color:Color.BLUE, offset:1.0}
]);
}
insert rect into group.content;
var anim = Timeline{
repeatCount: Timeline.INDEFINITE;
autoReverse: true;
keyFrames: KeyFrame{
time: 2s
values: colorValue => 1.0;
}
}
Search WWH ::




Custom Search