我有一个CABasicAnimation
带有 a.fromValue
和 a.toValue
的带有 202 个图像的 PNG 图像移动并一张一张地显示它们
我也曾经CALayer
拿着 image.png
它按顺序传递所有图像的问题我想按我将放入的帧显示图像NSArray
这是我的代码:
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"sampleIndex"];
anim.fromValue = [NSNumber numberWithInt:1];
anim.toValue = [NSNumber numberWithInt:203];
anim.duration = 1.75f;
anim.repeatCount = HUGE_VALF;
anim.autoreverses = YES;
[myImage addAnimation:anim forKey:nil];
帧数组是:
frames = (753, 377, 798, 422) ,
(706, 377, 751, 422) ,
(659, 377, 704, 422) ,
(612, 377, 657, 422) ,
(565, 377, 610, 422) ,
(518, 377, 563, 422) ,
(518, 424, 563, 468) ,
(471, 424, 516, 468) ,
(424, 424, 469, 468) ,
(471, 377, 516, 422) ,
(424, 377, 469, 422) ,
(377, 377, 422, 422) ,
(330, 377, 375, 422) ,
等等 ....
有任何想法吗 ??