How do we accelerate animation if we are using images in iPhone SDK?

僤鯓⒐⒋嵵緔 提交于 2020-01-07 07:47:07

问题


I have series of images for animation, say Image 1 to 1000.

I plan to show these images in a sequence at uniform rate to show animation.

I want to know if there is a way by which I can accelerate the animation? Can I accelerate the rate of showing images?

Please let me know.


回答1:


Use GIF images to play animation. Playing GIF files with OpenGLES is the good practice and I believe it is the best way to play animation.

Follow the Git Link: https://github.com/jamesu/glgif

:)




回答2:


There is so many way but simplest way is to Pass image array to UIImageView property animationImages. then call start Animatingto start the animation and stopAnimating method of UIImageView to stop the animation.

UIImageView also has the property animationDuration which allow to set the duration for every Images.

you can also render Images using OpenGL which is much faster compare to UIImageView. because OpenGL use the GPU.




回答3:


The solution is to skip frames of the animation. So, if you want to double the speed you will draw the 0,2,4,6 frames or 1,3,5,7 of the animation sequence. If you want to triple the speed you will draw 0,3,6,9 etc and so on. This is frame skipping :)



来源:https://stackoverflow.com/questions/8652471/how-do-we-accelerate-animation-if-we-are-using-images-in-iphone-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!