tomcat
/ / ViewController.m
// TOM
//
// Created by lanou on 16/7/12.
// Copyright©2016年lanou. All rights reserved.
//
#import"ViewController.h"
@interfaceViewController()
@property(weak,nonatomic)IBOutletUIImageView*TomCatView;
@end
@implementationViewController
- (void)viewDidLoad {
[superviewDidLoad];
// UIImageView *imageView = [UIImageView new];
//序列帧动画要播放的图片数组
// imageView.animationImages
//动画时长
// imageView.animationDuration
//动画重复次数
// imageView.animationRepeatCount
//开始动画
// [imageView startAnimating];
//结束动画
// [imageView stopAnimating];
//是否正在执行动画
// [imageView isAnimating]'
}
- (IBAction)eatBirdaction:(UIButton*)sender {
NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <40; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"eat_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=40*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)drinkaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <81; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"drink_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=81*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)knockoutaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <81; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"knockout_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=81*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)Tompieaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <24; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"pie_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=24*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)qiaoluoaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <13; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"Cymbal_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=13*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)Tomfartaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <28; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"fart_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=28*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)scratchaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <56; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"scratch_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=56*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)angryaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <26; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"angry_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=26*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)sromachaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <34; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"stomach_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=34*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)rightatcion:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <30; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"footright_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=30*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (IBAction)leftaction:(UIButton*)sender {NSMutableArray*images = [NSMutableArrayarray];
//创建可变数组images,负责存放要播放的图片数组
for(NSIntegeri =0; i <30; i++) {
//根据I来加载图片,添加到可变数组IMAGES里面、
//格式化图片
NSString*imageName = [NSStringstringWithFormat:@"footleft_%02ld.jpg",i];
//根据格式化的图片名加载图片image
UIImage*image = [UIImageimageNamed:imageName];
//将图片image添加到数组images中
[imagesaddObject:image];
}
//设置动画图片数组
self.TomCatView.animationImages= images;
//设置动画时长
self.TomCatView.animationDuration=30*0.075;
//重复次数
self.TomCatView.animationRepeatCount=1;
//开始动画
[self.TomCatViewstartAnimating];
}
- (void)didReceiveMemoryWarning {
[superdidReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end