addTiles(builder, Rect2i.createFromMinAndSize(border.getLeft(), 0, centerHoriz, border.getTop()), Rect2f.createFromMinAndMax(left, 0, right, top),
new Vector2i(textureSize.x - border.getTotalWidth(), border.getTop()),
Rect2f.createFromMinAndMax(leftTex, 0, rightTex, topTex));
} else {
addRectPoly(builder, left, 0, right, top, leftTex, 0, rightTex, topTex);
addTiles(builder, Rect2i.createFromMinAndSize(0, border.getTop(), border.getLeft(), centerVert), Rect2f.createFromMinAndMax(0, top, left, bottom),
new Vector2i(border.getLeft(), textureSize.y - border.getTotalHeight()),
Rect2f.createFromMinAndMax(0, topTex, leftTex, bottomTex));
} else {
addRectPoly(builder, 0, top, left, bottom, 0, topTex, leftTex, bottomTex);
Rect2f.createFromMinAndMax(left, top, right, bottom),
new Vector2i(textureSize.x - border.getTotalWidth(), textureSize.y - border.getTotalHeight()),
Rect2f.createFromMinAndMax(leftTex, topTex, rightTex, bottomTex));
} else {
addRectPoly(builder, left, top, right, bottom, leftTex, topTex, rightTex, bottomTex);
if (tile) {
addTiles(builder, Rect2i.createFromMinAndSize(region.width() - border.getRight(), border.getTop(), border.getRight(), centerVert),
Rect2f.createFromMinAndMax(right, top, 1, bottom),
new Vector2i(border.getRight(), textureSize.y - border.getTotalHeight()),
Rect2f.createFromMinAndMax(rightTex, topTex, 1, bottomTex));
} else {
addRectPoly(builder, right, top, 1, bottom, rightTex, topTex, 1, bottomTex);
Rect2f.createFromMinAndMax(left, bottom, right, 1),
new Vector2i(textureSize.x - border.getTotalWidth(), border.getBottom()),
Rect2f.createFromMinAndMax(leftTex, bottomTex, rightTex, 1));