1 Replies - 226 Views - Last Post: 10 November 2012 - 08:12 AM Rate Topic: -----

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

image not being flip vertical

Posted 10 November 2012 - 05:50 AM

 AffineTransform tx = new AffineTransform();
        tx.translate(0, 100);
        tx.rotate(233);
        tx.setToRotation(34, 333, 333, 222);
            g.drawImage(player_image, x, y, x+width, y+height, 
                50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1);






not sure what iam doing wrong. this code below just display image

     g.drawImage(player_image, x, y, x+width, y+height, 
            50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1);



now how can i flip it verical?

Is This A Good Question/Topic? 0
  • +

Replies To: image not being flip vertical

#2 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

Re: image not being flip vertical

Posted 10 November 2012 - 08:12 AM

ah ok i begning to see how AffineTransform works

Graphics2D g2d = (Graphics2D) g;

tx.scale(-1, 1);
g2d.setTransform(tx);
g.drawImage(player_image, x, y, x+width, y+height,
50*(int)frame, 147, 50*(int)frame+50, 189 ,Sprite_Sheet.m1);

this seem to be working but the thing is. i have alot of g.drawImage in side method. but i only want to filp one image. for some reason ths filps the more images.

also i already tried g2d for draw image but still no luck.

This post has been edited by hwoarang69: 10 November 2012 - 08:13 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1