创建一个滚动的球
如何使球(UIImageView)在坚固的平台(地面)上连续“滚动”?我对 iPhone 上的动画还是个新手。谢谢
How would you make it so a ball (UIImageView) "rolls" on a solid platform (ground) continuously? I am brand new to animation on the iPhone. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 UIImageView 内置的动画功能。您将滚球动画的所有帧作为数组中的图像提供,并将其提供给 UIImageView。然后它会按顺序播放这些图像,有点像 GIF 动画。
我想您可以将 UIImageView 放在移动(或不移动?)的背景之上,以产生球正在滚动的错觉。
您可能还会发现 Cocos2d 框架很有帮助。
You can use the animation features built into UIImageView. You provide all the frames of the rolling ball animation as images in an array, and feed that to the UIImageView. It will then play those images in order, kind of like an animated gif.
I suppose you could then just put the UIImageView on top of a background that moves (or doesn't?) to give the illusion that the ball is rolling.
You might also find the Cocos2d framework helpful.