Search:

Type: Posts; User: Norm

Search: Search took 0.18 seconds.

  1. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    All the hands should move every second, but by different amounts.
  2. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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...
  3. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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...
  4. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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.
  5. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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);
    }
  6. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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...
  7. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    Can you explain what is happening and what you see that is different.
  8. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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.
  9. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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;

    ...
  10. Replies
    24
    Views
    3,055

    Re: Drawing images with different angles

    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
Results 1 to 10 of 10