Game Development Reference
In-Depth Information
The JavaFX Transition Class: An Animation Subclass for Trans-
ition Effects Application
The JavaFX Transition class is a subclass of the JavaFX Animation superclass, so its
inheritance hierarchy starts with the Java 8 masterclass, java.lang.Object, progressing
down to the Transition class, as follows:
> java.lang.Object
> javafx.animation.Animation
> javafx.animation. Transition
The Transition class is a public abstract class, and, as such, it can only be used
(subclassed or extended) to create transition subclasses. In fact, ten of these subclasses
have already been created for you to use to create your own transition special effects;
these are the SequentialTransition , FadeTransition , FillTransition , PathTransition ,
PauseTransition , RotateTransition , ScaleTransition , TranslateTransition , Paral-
lelTransition , and StrokeTransition classes. As a subclass of Animation, the Trans-
ition class contains all the functionality of Animation.
Chances are you will end up using the ten custom transition classes directly, as they
provide the different types of transitions you are likely to want to use (fades, fills, path
based, stroke based, rotate, scale, movement, and so on). I am going to move on to the
AnimationTimer class next, as we will be using this class for our game engine during
the topic.
The JavaFX AnimationTimer Class: Frame Processing,
Nanoseconds, and Pulse
The JavaFX AnimationTimer class is not a subclass of the JavaFX Animation super-
class, so its inheritance hierarchy starts with the Java 8 masterclass, java.lang.Object,
and looks like this:
> java.lang.Object
> javafx.animation. AnimationTimer
What this means is that the AnimationTimer class is scratch coded specifically to
offer AnimationTimer functionality to JavaFX and that it is not related to the Anima-
tion (or Timeline or Transition) class or subclasses in any way. For this reason, the
Search WWH ::




Custom Search