meetpd
meetpd

Reputation: 9219

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

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.

Upvotes: 0

Views: 400

Answers (3)

Summon
Summon

Reputation: 968

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 :)

Upvotes: 0

DShah
DShah

Reputation: 9876

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

:)

Upvotes: 1

iOSPawan
iOSPawan

Reputation: 2894

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.

Upvotes: 0

Related Questions