ios开发的tom,全部素材和源代码,战士部分代码 //调用button监听方法 -(IBAction)tomAction:(UIButton *)button{ [self tomAnimationWithName:button.currentTitle count:button.tag]; } //让tom猫动起来,name是要执行动作的名字 count是图片的个数 -(void) tomAnimationWithName:(NSString *) name count:(NSInteger) count { //如果动画正在播放就返回不执行 if (self.tom.isAnimating) { return; } //序列帧动画 播放一组图片 //指定动画图片的数组 NSMutableArray *arrayM = [NSMutableArray array]; //添加动画播放的素材 for (int i = 0; i<count; i++) { NSString *imageName = [NSString stringWithFormat:@"%@_d.jpg",name,i]; // UIImage *image = [UIImage imageNamed:imageName]; // 得到全路径名字 NSString *path = [[NSBundle mainBundle] pathForResource:imageName ofType:nil]; UIImage *image = [UIImage imageWithContentsOfFile:path]; arrayM[i] = image; };
- 1
- 2
- 3
- 4
- 5
- 粉丝: 878
- 资源: 29
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- keil2 + proteus + 8051.exe
- 1961ee27df03bd4595d28e24b00dde4e_744c805f7e4fb4d40fa3f695bfbab035_8(1).c
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- windows注册表编辑工具
- mediapipe-0.9.0.1-cp37-cp37m-win-amd64.whl.zip
- 校园通行码预约管理系统20240522075502
- 车类型数据集6250张VOC+YOLO格式.zip
- The PyTorch implementation of STGCN.STGCN-main.zip
- 092300108.cpp
- 车类型数据集6000张VOC+YOLO格式.zip
- 1
- 2
- 3
- 4
- 5
前往页