public void drawMirrorImage(LImage img, int x, int y) { if (img != null) { int w = img.getWidth(); int h = img.getHeight(); g2d.drawImage(img.getBufferedImage(), x + w, y, x, y + h, 0, 0, w, h, null); } }
public void drawImage(LImage img, int x, int y, int anchor) { if (img != null) { int newx = x; int newy = y; if (anchor == 0) { anchor = TOP | LEFT; } if ((anchor & RIGHT) != 0) { newx -= img.getWidth(); } else if ((anchor & HCENTER) != 0) { newx -= img.getWidth() / 2; } if ((anchor & BOTTOM) != 0) { newy -= img.getHeight(); } else if ((anchor & VCENTER) != 0) { newy -= img.getHeight() / 2; } g2d.drawImage(img.getBufferedImage(), newx, newy, null); } }