iPhone 应用程序从最后一个位置旋转图像

发布于 2024-08-27 21:26:16 字数 349 浏览 4 评论 0原文

我正在尝试创建一个动画旋转图像。这一切都很好,我正在使用 CABasicAnimation,如该线程 如何使用cocos2d 中的动画?

我的问题是我想多次旋转图像随机次数,并且我想从最后的位置旋转它。目前,我可以让图像旋转,它会在随机位置完成,但如果我尝试添加另一个旋转,它会将图像重置为其初始位置。我多年来一直在寻找解决方案,如果有人有任何提示,我将不胜感激。

我想我想复制拾取器旋转,但有一个围绕中心点旋转的二维图像 - 如果这更清楚的话!

谢谢

I am trying to create an animated spinning image. This is all fine and I am using CABasicAnimation as described in this thread how can I use animation in cocos2d?

My problem is that I want to spin the image more than once a random number of times and I want to spin it from it's last position. At the moment I can get the image to spin, it finishes in a random position but then if I try to add another spin it resets the image to its initial position. I have been searching for a solution for ages now, if anyone has any tips that would be most appreciated.

I guess I want to replicate the picker spinning but with a 2d image spinning around a central point - if that is clearer!

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北方。的韩爷 2024-09-03 21:26:16

你定了

animation.cumulative = YES;

吗?

那应该让动画从上一个停止的地方继续。

Did you set

animation.cumulative = YES;

?

That SHOULD have the animation continue from where the previous one left off.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文