How do you flip an image?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Anthony Follari
    New Member
    • Aug 2010
    • 1

    How do you flip an image?

    Hello,

    I've been working on a simple Java platformer and I need some help with image manipulation. I'm looking for a way to flip (about the y-axis) the various player sprites I have depending on the direction of the player (left/right). I've tried a bunch of Google searches and they all seem to suggest the "AffineTransfor m" class but I'm really not sure how you use it. I don't just want to paint a flipped image to the screen but rather be able to generate a new "flipped image" from an existing image that I've loaded in. What I'm really looking for is a way to fill in this method body...

    Code:
    public Image flipImage(Image image1){
    //returns image1 flipped about the y-axis
    }
    Any help would be greatly appreciated!

    Thanks for reading!
Working...