1
A
回答
1
您可以像旋轉單個紋理一樣旋轉它們,但需要將每個紋理的原點設置爲旋轉圓弧的中心(在圖像的情況下是左下角),所以一些你需要使用基本的數學運算來正確地設置每個紋理,以便遠離的紋理圍繞與最近紋理相同的點進行旋轉。
從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
相關問題
- 1. 如何使用多紋理作爲一個紋理?
- 2. AndEngine - 多個紋理在一個紋理上重疊Atlas
- 3. 如何從N個紋理生成一個紋理?
- 4. 將ARGB紋理轉換爲下一個2紋理紋理的快速方法
- 5. 在同一像素着色器中採樣多個紋理並渲染到多個紋理
- 6. 我怎樣才能紋理一個GL_TRIANGLE_STRIP?
- 7. LibGdx紋理包裝
- 8. libGDX紋理「拉伸」
- 9. 切割紋理libgdx
- 10. Libgdx紋理動畫
- 11. LibGDX - 圓形紋理
- 12. GLSL中的多個紋理 - 只有一個可以工作
- 13. XNA旋轉紋理2D
- 14. 使用glDrawTexiOES旋轉紋理
- 15. OpenGL ES的旋轉紋理
- 16. 在另一個紋理上重複紋理的一部分
- 17. 在opengl中繪製兩個紋理到一個新紋理
- 18. 如何在XNA4中紋理多個紋理的圓柱體?
- 19. OpenGL:處理紋理時至少綁定一個紋理?
- 20. Cinder如何紋理一個.obj trimesh
- 21. 多個EAGLViews,但每個紋理只有一個副本 - 如何?
- 22. LibGdx/Android Studio:管理紋理/紋理大小的最佳方法?
- 23. 在一個圖像文件中使用多個紋理
- 24. mipmapped紋理如何採樣?
- 25. 從一個紋理文件中獲取單獨的紋理
- 26. 將xna中的紋理複製到另一個紋理中
- 27. 將紋理數據從一個紋理部分移動到另一個部分
- 28. LibGDX紋理渲染順序
- 29. LibGDX紋理不會繪製
- 30. Android Studio Libgdx黑色紋理