在 andEngine 中旋转精灵。在某个角度、某个时间

发布于 2024-12-17 02:48:07 字数 466 浏览 3 评论 0原文

我在 andEngine 中有一个精灵。我想做的就是一次又一次地旋转它一定的角度。现在的问题是,当我旋转精灵时,它只会改变角度。 但我想按顺序旋转它。例如,如果我当前的角度为零,下一个角度为 180。那么精灵应该像这样移动 0 1 2 3 4 5 6 7 8 9 10...180。 我希望我澄清了我的问题。我认为 andEngine 中有类似的东西

new RotationModifier(
                    10,                 // duration
                    0,                  // angle start                
                    -360                // angle end
                )

,但我不知道如何在我的类中使用它,它扩展了我的 Sprite 类。

I have a sprite in andEngine. All I want to do is to rotate it on a certain angle again and again. Now the problem is that when I rotate the sprite it only changes it angle.
But I want to rotate it in a sequence. For example if my current angle is zero and next angle is 180. Then the sprite should move like this 0 1 2 3 4 5 6 7 8 9 10...180.
I hope I cleared my question. I think there is something like this in andEngine like

new RotationModifier(
                    10,                 // duration
                    0,                  // angle start                
                    -360                // angle end
                )

But I dont know how to use it in my class which is extended my Sprite class.

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

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

发布评论

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

评论(1

奢欲 2024-12-24 02:48:07

每个“实体”(其中 Sprite 是其子类)都有方法 registerEntityModifier(IEntityModifier)。

修饰符可以嵌套(有点像输入流),因此您可能需要研究 LoopEntityModifier、SequenceEntityModifier 和 ParallelEntityModifier。

Every 'Entity' (where Sprite is a subclass of), has the method registerEntityModifier(IEntityModifier).

Modifiers can be nested (kind of like InputStreams), so you might want to look into LoopEntityModifier, SequenceEntityModifier and ParallelEntityModifier.

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