As you read this chapter, you will find out that JavaFX provides a powerful animation engine that lets you create complex sequences (see the Introduction). However, if your need is to create simple straightforward animated sequences, JavaFX has got you covered. In this recipe, we will explore how to create simple animations quickly using the JavaFX Transition API.
Before you can create transition-based animations, you must be familiar with the steps required to create simple shapes using the Shape API. See Chapter 2, Drawing simple shapes for background information on creating simple shapes.
All of the classes provided by the Transition API are located in the package javafx.animation.transition
. There you will find several classes representing the type of animations they support, including TranslateTransition, ScaleTransition, PathTransition, FadeTransition
, and RotateTransition
.
The next code snippet shown will use an instance...