2017-05-05 87 views

回答

1

您可以像旋轉單個紋理一樣旋轉它們,但需要將每個紋理的原點設置爲旋轉圓弧的中心(在圖像的情況下是左下角),所以一些你需要使用基本的數學運算來正確地設置每個紋理,以便遠離的紋理圍繞與最近紋理相同的點進行旋轉。

Rotation from origin point example

從API:https://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g2d/Sprite.html

//Set the origin in relation to the sprite's position for scaling and rotation. 
yourSprite.setOrigin(float originX, float originY) 

//Sets the sprite's rotation in degrees relative to the current rotation. 
//Rotation is centered on the origin set in setOrigin(float, float) 
yourSprite.rotate(float degrees) 

這些問題和答案可以幫助你:

https://gamedev.stackexchange.com/a/75330

https://gamedev.stackexchange.com/questions/119870/libgdx-sprite-rotation-around-specific-point