While transition-based animation classes provide a quick and easy way to animate objects in the scene graph, they expose little control over the way the animation steps are constructed. For instance, when you build an animation sequence with the TranslateTransition
class, you can only specify the origin and the destination points of the object. The class automatically fills in the frames in between. This recipe covers keyframe-based animation techniques. Using this approach, developers are able to take full control over the animation sequence by specifying the keyframes that make up the animation.
Although optional, it is helpful to be familiar with the transition-based animation presented in the recipe Creating simple animation with the Transition API, as it includes valuable information about animation and animation controls. Creating keyframe animation involves two main classes, Timeline
and KeyFrame
, found in the package javafx...