How to Rotate AWT rectangle in JAVA?
问题 I am creating a small java 2D game and i want to know if there is any way to rotate AWT rectangle AffineTransform origXform = g2d.getTransform(); AffineTransform newXform = (AffineTransform) origXform.clone(); newXform.rotate(angle, pivotX, pivotY); // pivotX ,pivotY is the starting point of the hand image g2d.setTransform(newXform); Rectangle arm = new Rectangle(bowX + 5, bowY + 55, 60, 5); g2d.drawImage(playerBowReadyImg, bowX, bowY, null); //hand image on the above code i simply draw the