public void draw(Graphics g, int x, int y, int width, int height){
		if(img == null)
			return;
		at = new AffineTransform();
		at.translate(x, y);
		if (img.getWidth() != width) {
			at.scale((double)width/(double)img.getWidth(), 1);
		}
		if (img.getHeight() != height) {
			at.scale(1, height/(double)img.getHeight());
		}
		Graphics2D g2d = (Graphics2D) g;
		g2d.drawImage(img, at, null);
	}