code: public void fillRect(float x, float y, float width, float height,
  			Image pattern, float offX, float offY) {
  		int cols = ((int) Math.ceil(width / pattern.getWidth())) + 2;
  		int rows = ((int) Math.ceil(height / pattern.getHeight())) + 2;
  
  		Rectangle preClip = getWorldClip();
  		setWorldClip(x, y, width, height);
  
  		predraw();
  		// Draw all the quads we need
  		for (int c = 0; c < cols; c++) {
  			for (int r = 0; r < rows; r++) {
  				pattern.draw(c * pattern.getWidth() + x - offX, r
  						* pattern.getHeight() + y - offY);
  			}
  		}
  		postdraw();
  
  		setWorldClip(preClip);
  	}
docs: Tile a rectangle with a pattern specifing the offset from the top corner
  that one tile should match
  
  @param x
  The x coordinate of the rectangle
  @param y
  The y coordinate of the rectangle
  @param width
  The width of the rectangle
  @param height
  The height of the rectangle
  @param pattern
  The image to tile across the rectangle
  @param offX
  The offset on the x axis from the top left corner
  @param offY
  The offset on the y axis from the top left corner