Java Reference
In-Depth Information
TranslateTransition scrollUp = new
TranslateTransition();
scrollUp.setNode(theEnd);
scrollUp.setDuration(Duration.seconds(1));
scrollUp.setInterpolator(Interpolator.EASE_IN);
scrollUp.setFromY(scene.getHeight() + 40);
scrollUp.setToY(scene.getHeight()/2);
return scrollUp;
}
Figure 16-6 depicts the "The End" text node scrolling along after the
OnEndOfMedia event is triggered.
Figure 16-6 . Animating “The End”
How It Works
This recipe showcases how to synchronize events to animated effects. In the code ex-
ample, when the video reaches the end, an OnEndOfMedia property event initiates a
Runnable instance. Once the instance is initiated, a TranslateTransition an-
imation is performed by scrolling a Text node upward that contains the string "The
End" .
 
 
Search WWH ::




Custom Search