iPhone Best practices for large number of animations using UIImageView

后端 未结 2 1142
执念已碎
执念已碎 2021-01-29 02:27

Just requesting a little advice animating images on the iphone. I\'m building an app that consists of a character with 5 animations.

Each animation consists of roughly

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-29 02:41

    Have you tried setting the animationImages property on a UIImageView with an array of UIImages representing your frames. I have done that in the past and it worked pretty well, but I didn't have as many images as you in my animation.

    If there is too much data in your images, you may have to do something more complex, like a sprite atlas. That method combines a bunch of your frames as one image and then animates the frames by changing the viewable portion of the big image. That way the whole thing loads at once and the animation just changes the part of the image that the user sees. Cocos2D has a bunch of functionality around sprite animation. If the animationImages thing doesn't work, you might want to try that.

    --Mike

提交回复
热议问题