我目前正在嘗試旋轉圖像,然後在不旋轉的頂部繪製圖像。但每當我使用: g2d.rotate(Math.toRadians(rot), (x+15), (y+15));
我後來繪製的每個圖像也旋轉。有沒有什麼辦法可以旋轉一張圖片,而不是旋轉其餘的圖片(真的很難解釋)。 這裏是我的油漆方法:在另一個圖像下旋轉一個圖像
public void draw(Graphics2D g2d)
{
move();
if(bo.px==+1)rot--;
if(bo.px==-1)rot++;
g2d.rotate(Math.toRadians(rot), (x+15), (y+15));
g2d.drawImage(img, x, y, null);//this should rotate
g2d.drawImage(shine, x, y, null);//this shouldn't
}
在此先感謝。
非常感謝,解決了我的問題! +1 – chrypthic