June 2017
Beginner
1296 pages
69h 23m
English
Timeline AnimationsIn this section, we continue our animation discussion with a Timeline animation that bounces a Circle object around the app’s Pane over time. A Timeline animation can change any Node property that’s modifiable. You specify how to change property values with one or more KeyFrame objects that the Timeline animation performs in sequence. For this app, we’ll specify a single KeyFrame that modifies a Circle’s location, then we’ll play that KeyFrame indefinitely. Figure 22.12 shows the app’s FXML, which defines a Circle object with a five-pixel black border and the fill color DODGERBLUE.
1 <?xml version="1.0" encoding="UTF-8"?>
2 <%!-- Fig.22.12: TimelineAnimation.fxml -->
3 <%!-- FXML for a Circle that will be ...Read now
Unlock full access