All the hands should move every second, but by different amounts.
Type: Posts; User: Norm
All the hands should move every second, but by different amounts.
I don't really know. That was what I was taught. I suppose its like when you point at something you use your hand to do it. Pointer would be another good name. They do need to be associated with the...
The names you have for the different hands makes it hard to know which is which.
Could you rename them to represent which hand they are?
I can not understand what your problem is other than the...
The order of the method calls shouldn't change the position of where the hand is drawn. It would change which hand was drawn on top.
public void paintHand(Graphics g, Pointer ptr){
Graphics2D g2d = (Graphics2D) g;
g2d.rotate(ptr.getAngle() * (Math.PI/180));
g2d.drawImage(ptr.getImg(), -44 ,-140, this);
}
Since the three methods you call do the same thing, you should change them to one method and pass it a reference to the object that has the angle and image. There should only be one method that is...
Can you explain what is happening and what you see that is different.
Sounds like you need to save and restore the settings of the Graphics2D context. The code I posted did that for the transform. I don't know what code you are using.
Here's some code that will rotate an image. It needs a bit of work.
int x = 100; // Try various values here
int y = 10;
currentAngle += 10;
...
I just found some code in the Java tutorial that does rotation.
The tutorial is on my disk but the path should be similiar to that online.
file:///E:/Java/Tutorial_1.6/2d/advanced/transforming.html