Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public void draw(Graphics g, double inter)
  2. {
  3. BufferedImage im;
  4. Graphics2D g2d = (Graphics2D)g;
  5. GImage gImage;
  6.  
  7. gImage = GImages.getImage(p.sprite);
  8. im = gImage.imageFile;
  9. AffineTransform at = new AffineTransform();
  10. at.translate((p.xcord+((float)p.width/2))+(p.xspd*inter), (p.ycord+((float)p.height/2))+(p.yspd*inter));
  11. at.rotate(p.angle+(Math.PI/2));
  12. at.scale((double)gImage.xsize/im.getWidth(), (double)gImage.ysize/im.getHeight());
  13. //at.translate(-(float)p.width/2, -(float)p.height/2);
  14. g2d.drawImage(im, at, null);
  15. g2d.setColor(Color.BLUE);
  16. g2d.drawRect((int)p.xcord,(int)p.ycord,1,1);
  17. //g.setColor(Color.BLACK);
  18. //g.drawString(p.suh, (int)(p.xcord+(p.xspd*inter)), (int)(p.ycord+(p.yspd*inter)));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement