Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

imaumac

macrumors member
Original poster
Oct 15, 2008
52
0
some body toldme to animate some png sequence:
we can use a timer.

but i dont know how to do it.
some one help please.

or another suggestion to animate 7 small png sequence please ?

thank a lot !
 
Check out the documentation of UIImageView. It has a whole group of method for animating images.
 
Really thanks, i was looking on documentation how do this.
and lookinf for UIImageView animation.
but I dont understand a lot.

is there a code to copy and paste please.
I am ashamed to ask, ...realy

please one more time sorry
but i realy need this.

is there most way to learn this on internet website?
or What is the easier code to learn please ?

its only 4 small png sequence (loop)

and I need to animate while you are reading a text please.
thanks a lot.
any help are realy welcome.

i found this URL but i dont know what is the best to learn:
https://developer.apple.com/iphone/l...ion/index.html
 
Lets see. The docs seem pretty clear. I have never done this before but it looks like this is how it works:

Make a UIImageView in interface builder and link it to an IBOutlet in your view controller.

Code:
imageArray = [NSArray arrayWithObjects:
    [UIImage imageNamed:@"frame1.png"],
    [UIImage imageNamed:@"frame2.png"],
    [UIImage imageNamed:@"frame3.png"],
    [UIImage imageNamed:@"frame4.png"],
    nil];

myImageView.animationImages = imageArray;
myImageView.animationDuration = 0.25 // Seconds
myImageView.animationRepeatCount = 0 // zero loops for ever
[myImageView startAnimating];

Duration and repeat count are not required and have good default values, but that is how you set them.
 
what about no looping?

Lets see. The docs seem pretty clear. I have never done this before but it looks like this is how it works:

Make a UIImageView in interface builder and link it to an IBOutlet in your view controller.

Code:
imageArray = [NSArray arrayWithObjects:
    [UIImage imageNamed:@"frame1.png"],
    [UIImage imageNamed:@"frame2.png"],
    [UIImage imageNamed:@"frame3.png"],
    [UIImage imageNamed:@"frame4.png"],
    nil];

myImageView.animationImages = imageArray;
myImageView.animationDuration = 0.25 // Seconds
myImageView.animationRepeatCount = 0 // zero loops for ever
[myImageView startAnimating];

Duration and repeat count are not required and have good default values, but that is how you set them.

What about : if I just want the animation runs 1 time then stops (no looping), and the last frame (frame4.png) remains on the screen. How should I do this? Thanks in advance.
 
Code:
[COLOR="Green"]//your animation method[/COLOR]
- (void)flashFadeIn
	{
	[UIView beginAnimations:@"flashFadeIn" context:NULL];
	[UIView setAnimationDelegate:self];
	[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];
	[UIView setAnimationBeginsFromCurrentState:currentStateBOOL];
	[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
	[UIView setAnimationRepeatCount:repeatCount];
	[UIView setAnimationDuration:kAnimationFlashFadeInDuration];
	
		[self.flash setAlpha:1.0];
	
	[UIView commitAnimations];
	}

[COLOR="green"]//your did stop selector[/COLOR]
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
	{
	if (([animationID isEqualToString:@"flashFadeIn"]) && finished)
		[self flashFadeOut];
		[COLOR="green"]//or do whatever else you want when the flashFadeIn animation finishes[/COLOR]
	}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.