What is an animation?

From a JavaFX point of view, an animation is a change of a property over a period of time; for example:

  • If you want an object to move, you need to work with coordinate properties.
  • If you want to shrink or enlarge an object, you can use the scale property.
  • You can even use the Animation API for objects which don't have a visual representation at all.

You need the following three API classes to create an animation:

  • KeyFrame represents a point in time
  • KeyValue describes the value the desired property should have at the moment described by KeyFrame
  • Timeline collects all KeyFrame objects and runs the animation, calculating all intermediate values for properties between KeyFrame objects.

In the next section, we will review these concepts with an example.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.171.153