當你畫它的批次您可以旋轉你的紋理權。
SpriteBatch.draw(textureRegion.getTexture(), x, y, originX, originY, width, height, scaleX, scaleY, rotation, srcX, srcX, srcWidth, srcHeight, false, false);
所以上面是你需要在x軸,y軸或兩者上旋轉圖像的確切代碼。
其中:
x - the x-coordinate in screen space
y - the y-coordinate in screen space
originX - the x-coordinate of the scaling and rotation origin relative to the screen space coordinates
originY - the y-coordinate of the scaling and rotation origin relative to the screen space coordinates
width - the width in pixels
height - the height in pixels
scaleX - the scale of the rectangle around originX/originY in x
scaleY - the scale of the rectangle around originX/originY in y
rotation - the angle of counter clockwise rotation of the rectangle around originX/originY
srcX - the x-coordinate in texel space
srcY - the y-coordinate in texel space
srcWidth - the source with in texels
srcHeight - the source height in texels
在2D中,可以通過從1到-1在y方向上縮放和背面使用正確的(竇)內插 –
模擬x軸旋轉可以請你告訴我一個簡單的代碼那實現了嗎? –