#import"ViewController.h"
@interfaceViewController()
@property(weak,nonatomic)IBOutletUIImageView*tomcatView;
@end
@implementationViewController
- (IBAction)stomach:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<34; i++) {
//根據(jù)i加載圖片刹悴,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"stomach_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=34*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)right:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<30; i++) {
//根據(jù)i加載圖片虹钮,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"footleft_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=30*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)left:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<30; i++) {
//根據(jù)i加載圖片灰嫉,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"footright_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=30*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)scratch:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<56; i++) {
//根據(jù)i加載圖片,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"scratch_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=56*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)Plain:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<24; i++) {
//根據(jù)i加載圖片翼悴,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"pie_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=24*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)fartAction:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<28; i++) {
//根據(jù)i加載圖片少态,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"fart_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=28*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)cymbalAction:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<13; i++) {
//根據(jù)i加載圖片烦却,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"cymbal_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=13*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)drinkAction:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<81; i++) {
//根據(jù)i加載圖片仔引,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"drink_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=81*0.050;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (IBAction)eatBirdAction:(UIButton*)sender {
NSMutableArray*images=[NSMutableArrayarray];
for(NSUIntegeri=0; i<40; i++) {
//根據(jù)i加載圖片,然后添加到可變數(shù)組images里面
NSString*imageName= [NSStringstringWithFormat:@"eat_%02d.jpg",i];
//根據(jù)格式化的圖片加載圖片images
UIImage*image = [UIImageimageNamed:imageName];
//將圖片images添加到數(shù)組images中
[imagesaddObject:image];
}
//設置動畫圖片數(shù)組
self.tomcatView.animationImages= images;
//設置動畫時長
self.tomcatView.animationDuration=40*0.075;
//設置動畫重復次數(shù)
self.tomcatView.animationRepeatCount=1;
//開始動畫
[self.tomcatViewstartAnimating];
}
- (void)viewDidLoad {
[superviewDidLoad];
UIImageView*imageView=[UIImageViewnew];
//序列幀動畫要播放的圖片數(shù)組
//imageView.animationImages
//動畫時長
//imageView.animationDuration
//動畫重復次數(shù)
//imageView.animationRepeatCount
//開始動畫
//[imageView startAnimating];
//結束動畫
//[imageView stopAnimating];
//是否正在執(zhí)行
//[imageView isAnimating]
}
- (void)didReceiveMemoryWarning{
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be
recreated.
}
@end