Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) startImageViewAnimation:(UIImageView *)imageView WithImages:(NSArray*)imageArray orBuildArrayWithImage:(NSString *)imageName duration:(CGFloat)duration repeatCount:(NSInteger)repeatCount soundFile:(NSString *)soundFile stopSoundAfterDuration:(CGFloat) stopSoundDuration
- {
- if([imageName length] != 0)
- {
- NSMutableArray *array = [[NSMutableArray alloc] init];
- UIImage *image;
- int index = 1;
- NSString *string;
- do
- {
- string = [NSString stringWithFormat:@"%@%02d.png", imageName, index++];
- image = [UIImage imageNamed:string];
- if(image)
- [array addObject:image];
- } while (image != nil);
- imageView.animationImages = array;
- [array release];
- }
- else
- {
- imageView.animationImages = imageArray;
- }
- imageView.animationDuration = duration;
- imageView.animationRepeatCount = repeatCount;
- [imageView startAnimating];
- if([soundFile length] != 0)
- {
- [self loadSoundEffectAudio:soundFile];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement