iPhone开发:动画PNG序列 [英] iPhone Dev: Animating PNG Sequences
问题描述
什么是动画PNG序列最好或推荐的方法。
继承人我学到的东西:
What is the best or recommended technique for animating PNG Sequences.
Heres what I've learned:
做手工
使用包含字符串MutableArrays能够绘制一个UIImageView与增量索引编号的定时器
Do it Manually
Using MutableArrays containing Strings, you can animate a UIImageView with a timer which increments an index number
的UIImage - 动画制作方法
这工作,唯一的问题是找到,如果图像已经完成了它的动画,你必须检查isAnimating BOOL,要做到这一点你需要一个计时器。
UIImage - animation methods
This works, the only problem is to find if an image has completed its animation, you have to check the isAnimating BOOL, and to do that you need a timer.
什么是最好的,并建议?
的寻找做旧校园游戏精灵动画的
即:
待机动画
攻击动画
走动画
等...
让我知道如果任何人有什么的。
Idle Animation
Attack Animation
Walk Animation
ect...
Let me know if any one has something.
@lessfame
@lessfame
推荐答案
例动画箭头
UIImage* img1 = [UIImage imageNamed:@"fleche1.png"];
UIImage* img2 = [UIImage imageNamed:@"fleche2.png"];
NSArray *images = [NSArray arrayWithObjects:img1,img2, nil];
UIImageView* imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 160.0, 160.0)];
[imageView setAnimationImages:images];
[imageView setAnimationRepeatCount:100];
[imageView setAnimationDuration:3.0];
imageView.center = myView.center;
[imageView startAnimating];
[myView addSubview:imageView];
[imageView release];
这篇关于iPhone开发:动画PNG序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!