iphone - What kind of value is keyTime in an CAKeyFrameAnimation? -
For example I have this CAKeyFrameAnimation:
CALayer * theLayer = myView.layer; CAKeyframeAnimation * Animation; Animation = [CAKeyframeAnimationwith animation: @ "transform.rotation.z"]; Animation. Duration = 1.6; //animation.cumulative = yes; Animation. RepeatCount = 1; Animation. RemovedOnCompletion = No; Animation.philmedia = kCFilModford; animation.values = [NSArray arrayWithObjects: [NSNumber numberWithFloat: 0.0 * M_PI], [NSNumber numberWithFloat: (15.0 / 180.0) * M_PI], [NSNumber numberWithFloat: (30.0 / 180.0) * M_PI], // animation stops here it happens .. . [NSNumber Number Explode (45.0 / 180.0) * Mopi, // Ignore! [NSNumber Number explosion (190.0 / 180.0) * MOPI], zero]; // Ignored! animation.keyTimes = [NSArray arrayWithObjects: [NSNumber numberWithFloat: 0.0], [NSNumber numberWithFloat: 0.2], [NSNumber numberWithFloat: ignored 0.4]; //! [Float: [0.8] with NSNumber Number, // Ignored! [Float with NSNumber number: 1.6], zero]; // Ignored! animation.timingFunctions = [NSArray arrayWithObjects: [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear], [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionLinear], nil]; [TheLayer addAnimation: animation fork: @ "transform.rotation.z"];
Do not get me:
a) Key time values have been completed since the full time the animation has started
B) How long are the time values used to just use this special key frame?
There are here a little oddly phrased, but precise: each value in the array is a floating point number between 0.0 and 1.0 and corresponds to an element in the elements of values. The corresponding key as part of the total duration of each element of the animation in time array define keyframe values period. Each element should be equal to the value, or the previous value, to be equal. Basically, each value indicates on the normalized point in the animation given-frame. So if the keyframe in the animation is 25%, the value will be 0.25. The confusing part of the docs, they point out that this is a period, when in fact it is the normalized point in time.
Comments
Post a Comment