Question

Im working on a 2d game where I do basically have my character standing in the middle of my iphone stage kicking balls. I build the character as a vector (with illustrator) and I want to know if is possible to animate it in after effects and export it in whatever format (I know I should use .png ) I can use in my iphone game.. The character won't have any interaction with the user and it will basically loop (kicking balls) untile the user quit the game.

thanks Luca

Était-ce utile?

La solution

Yes its possible ;) but be careful your picture frames should not be a long animation , you can use UIImage to show an animation , the best format is PNG , so you can do it like this :

NSMutableArray* myImages = [[[NSMutableArray alloc] initWithCapacity:122] autorelease];
for( int i = 1; i <= 122; i++ ) {
    NSString* filename = [NSString stringWithFormat:@"animation_%d.png",i];
    UIImage* image = [UIImage imageNamed: filename];
    [myImages addObject: image];

}

myAnimation.animationImages = myImages;
[myAnimation setAnimationRepeatCount:10];
myAnimation.animationDuration = 0;
[myAnimation startAnimating];

the nubmer 122 is the animation frames .

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top