Graphics Reference
In-Depth Information
This standard of 24fps came about in the motion picture industry because the cost of film
was so expensive studio producers ran tests to determine how to maintain a smooth look
while using the fewest frames (and therefore the least amount of film) possible. Twenty-four
fps became the standard, and it is this rate that moviegoers have come to expect whether
they realize it. That's why you see many video camera manufacturers touting “film” or
“frame” mode in their cameras as this mimics film's vaunted 24fps. Have you ever watched
a feature film or something by the BBC? It probably feels strange to you, because these films
are most commonly shot at 60fps interlaced or 30fps, progressive scan. A movie buff will
notice the difference immediately.
In this chapter, we discuss how to move from basic animation to keyframe animation. It
is similar, so the transition should be smooth. We also introduce you to layer rotation and
how to add some content to your layer by drawing a path.
Changing Values Over Time
Core Animation offers a wide range of properties that you can animate. Keyframe anima-
tion is the process of changing one of these properties over time. You can think of a
keyframe animation as a group of basic animations strung together and run in sequence.
In the context of Core Animation, interpolation (which is analogous to tweening in film)
uses the value of a property between each keyframe to calculate the starting and stopping
values of the surrounding keyframes. Another way to think about this is to imagine the
bases of a baseball diamond. Each base is a key frame. The runner knows that when he
hits the ball, he must run to first base, then second base, third, and then home if he
wants to score a run (and doesn't get thrown out in the process). The steps between each
base don't concern him though he must run to get to each of those destinations.
Similarly, the animation in a keyframe animation runs to each destination point
(keyframe) in sequence until all destinations have been reached.
Of course, in the case of a baseball diamond shape, your last keyframe value would be the
same as your first.
Two Methods to Specify Keyframe Destinations
When you want to animate a property, you can either specify an array of values that the
property will reach in sequence, or you can specify a Core Graphics path:
.
An array of values is more readily used to specify things like color changes to back-
grounds and borders or border widths and rectangle sizes or even CGImage (s) for the
content key path. You can also animate the transform property by specifying a list
of CATransform3D objects to the values array.
 
 
Search WWH ::




Custom Search