這個畫面雖然只包含了4個元素(從上圖左手邊的objects可以看得出來),一張背景,一個小廚師的圖,一個獎牌,和小廚師身邊的星星。
實際上這6秒的畫面包含了以下的畫面:
1張背景
2張小廚師
- (void)chefAnimate{
animationChef.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"chef_verygood1.png"],
[UIImage imageNamed:@"chef_verygood2.png"],
nil];
[animationChef setAnimationRepeatCount:10];
animationChef.animationDuration = 1.5;
[animationChef startAnimating];
}
5張獎牌不同光澤
- (void)verygoodAnimate{
animationVerygood.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"medalVerygood1.png"],
[UIImage imageNamed:@"medalVerygood2.png"],
[UIImage imageNamed:@"medalVerygood3.png"],
[UIImage imageNamed:@"medalVerygood4.png"],
[UIImage imageNamed:@"medalVerygood5.png"],
[UIImage imageNamed:@"medalVerygood1.png"],nil];
[animationVerygood setAnimationRepeatCount:10];
animationVerygood.animationDuration = 1;
[animationVerygood startAnimating];
}
1張閃爍不停的星星
- (void)starAnimation{
starImage.alpha = 0;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
starImage.alpha = 1.0;
[UIView commitAnimations];
}
0 意見:
張貼留言