在 andEngine 中旋转精灵。在某个角度、某个时间
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个“实体”(其中 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.