答案 0 :(得分:1)
Sprite
有一个方法setOrigin()
,https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/Sprite.html#setOrigin-float-float-
将Sprite
的原点设置在圆圈的中心并旋转它。代码看起来与此类似:
float circleCenterX = ...;
float circleCenterY = ...;
float angle = ...;
Sprite sprite = ...;
sprite.setOrigin(circleCenterX, circleCenterY);
sprite.rotate(angle); // or sprite.setRotation(angle);