I wanted to get the same result, but I did not find the previous instructions given to be of any help. Neither I was able to find any other clear solution for this issue, so here's what I managed to get working after I read a bit of api-docs and did some testing of my own.
Texture splashTexture = new Texture("texture1.png"); // Remember to dispose splashTexture.getTextureData().prepare(); // The api-doc says this is needed Pixmap splashpixmap = splashTexture.getTextureData().consumePixmap(); // Strange name, but gives the pixmap of the texture. Remember to dispose this also Pixmap pixmap = new Pixmap(splashTexture.getWidth(), splashTexture.getHeight(), Format.RGBA8888); // Remember to dispose // We want the center point coordinates of the image region as the circle origo is at the center and drawn by the radius int x = (int) (splashTexture.getWidth() / 2f); int y = (int) (splashTexture.getHeight() / 2f); int radius = (int) (splashTexture.getWidth() / 2f - 5); // -5 just to leave a small margin in my picture pixmap.setColor(Color.ORANGE); pixmap.fillCircle(x, y, radius); // Draws the texture on the background shape (orange circle) pixmap.drawPixmap(splashpixmap, 0, 0); // TADA! New combined texture this.splashImage = new Texture(pixmap); // Not sure if needed, but may be needed to get disposed as well when it's no longer needed // These are not needed anymore pixmap.dispose(); splashpixmap.dispose(); splashTexture.dispose();
Then use the splashImage (which is a class variable of type Texture in my case) to render the combined image where you want it. The resulting image has the given background and the foreground is a png image which has transparent parts to be filled by the background color.
positionfor the "finalTexture" and the offsets of the singleTextures and then draw them in the right order.