Java Reference
In-Depth Information
How it works...
As mentioned earlier, the two main classes involved in creating keyframe-based animation
are Timeline and KeyFrame . These classes provide the necessary idiom to express the
video-timeline metaphor, as shown in the next figure.
Each timeline is composed of a collection of one or more keyframes (kf1 to kfN). Each
keyframe specifies a duration (ti) i ) and the values to be interpolated during that time. The
animation engine automatically calculates the in-between values for interpolation. Because
the time value of each keyframe may overlap each other, the length of an animation sequence
is determined by the keyframe with the latest time period. Hence, in the previous figure, the
animation length is t 4 (not the cumulative total).
The declarative syntax for creating timeline animation is as follows:
Timeline {
keyframes :[
KeyFrame :{
time :animation_duration
values :[interpolation_expression]
action :function():Void
}
]
}
where
F Timeline —stores keyframe instances in its keyframes property. It also controls and
manages the animation's playback.
 
Search WWH ::




Custom Search