imgPersonC, imgPersonV e imgSeta são do tipo BufferedImage.
[code]public void loadImg() {
imgPersonC = new Cangaceiro().getBufferedImage();
imgPersonV = new Volante().getBufferedImage();
imgSeta = new Seta().getBufferedImage();
}
public void onRender(Graphics2D graphics2d) {
graphics2d.drawImage(imgPersonC, personC.x, personC.y, null);
graphics2d.drawImage(imgPersonV, personV.x, personV.y, null);
graphics2d.translate((imgSeta.getWidth()) + seta.x, (imgSeta.getHeight()) + seta.y);
graphics2d.rotate(angle * (Math.PI/180));
graphics2d.translate(-((imgSeta.getWidth()) + seta.x), -((imgSeta.getHeight()) + seta.y));
graphics2d.drawImage(imgSeta, seta.x, seta.y, null);
graphics2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
}
public void render() {
Graphics2D graphics2d = (Graphics2D) bufferStrategy.getDrawGraphics();
graphics2d.setColor(Color.WHITE);
graphics2d.fillRect(0, 0, frame.getWidth(), frame.getHeight());
onRender(graphics2d);
graphics2d.dispose();
bufferStrategy.show();
}
public void onRender(Graphics2D graphics2d) {
graphics2d.drawImage(imgPersonC, personC.x, personC.y, null);
graphics2d.drawImage(imgPersonV, personV.x, personV.y, null);
graphics2d.translate((imgSeta.getWidth()) + seta.x, (imgSeta.getHeight()) + seta.y);
graphics2d.rotate(angle * (Math.PI/180));
graphics2d.translate(-((imgSeta.getWidth()) + seta.x), -((imgSeta.getHeight()) + seta.y));
graphics2d.drawImage(imgSeta, seta.x, seta.y, null);
graphics2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
}
[/code]