I'm making a game where the player throws a cube. I have 6 images that correspond to each cube, and I want to have shuffle effect like it's randomly choosing between 1-6. How can this be done?
Asked
Active
Viewed 163 times
1 Answers
1
Take a look at this post: Is it possible to animate an UIImage?
All you need to do is stop the animation when you have selected the random image.
As @kernix said in the comment, to stop the animation after it has animated once, all you need to do is set the repeat count to 1.
imageView.animationRepeatCount = 1
In order to have a callback method called after the animation, please see the following post: Access Method After UIImageView Animation Finish
-
I want it to stop animating when it gets the the last image in the array, is that possible? Yep need to set imageView.animationRepeatCount = 1; – kernix Aug 26 '12 at 12:15
-
is it possible to have a callback when the animation ended? – kernix Aug 26 '12 at 13:33
-
thanks, I ended up implemeting the animation myself using NSTimer. – kernix Aug 26 '12 at 14:45