I looked everywhere to see with anyone had the same problem than me but it seems I'm the only one getting this error.
So I'm in Java with Swing. I have a class Player
that draws an image of the player. However, each time I tried to use setTransform
to rotate my image, the second instance of player is scaled down by two.
Here is my code for the draw method:
AffineTransform transform = new AffineTransform();
transform.rotate(this.getOrientationRadians(), getX()+getWidth()/2,getY()+getHeight()/2);
g.setTransform(transform);
g.drawImage(image, (int)(getX()), (int)(getY()), null);
g.setTransform(new AffineTransform());