startPrimitive(Primitive.IMAGE, joglImage);
TextureCoords coords = joglImage.texture.getImageTexCoords();
float texTop = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * subImageY;
float texBottom = coords.top() + (coords.bottom() - coords.top()) / image.getHeight() * (subImageY + subImageHeight);
float texLeft = coords.left() + (coords.right() - coords.left()) / image.getWidth() * subImageX;
float texRight = coords.left() + (coords.right() - coords.left()) / image.getWidth() * (subImageX + subImageWidth);
if(flip == Flip.BOTH || flip == Flip.HORIZONTAL) {
float temp = texTop;
texTop = texBottom;