Java Reference
In-Depth Information
keyFrames: [
KeyFrame{
time: 0s
values: currentFraction => 0.0
},
KeyFrame{
time: 3s
values: currentFraction => 1.0
},
]
}
init{
draw();
animation.playFromStart();
}
public function draw():Void{
delete content;
var width = 256.0;
var height = 256.0;
var border = Rectangle{
width: width;
height: height;
fill: null;
stroke: Color.GRAY
strokeWidth: 3
}
insert border into content;
insert Text{
translateX: width/2.0 - 40
translateY: height - 2;
content: "<- fraction ->"
fill: Color.DARKGRAY
} into content;
insert Text{
translateX: -39
translateY: height/2.0
content: "<- 0.0 - 1.0 ->"
fill: Color.DARKGRAY
rotate: -90.0
} into content;
var samples = 64.0;
for (i in [0..samples]){
var fraction:Number = i/samples;
var value = (interpolator.interpolate(0.0, 1.0, fraction) as Number);
Search WWH ::




Custom Search