You can use "SetWrap" on your texture and create a TextureRegion based on that Texture.
Important: It took me a while to figure it out, but to be mirrored, your texture must be a power of two size. It was working on Android but not on iOS and you don't get a message - it was shown as black. So it must be 4x4 or 8x8, 16x16 .. 256x256 or 512x512 ..
To Create a 3x3 mirrored image (or axb size)
Texture imgTexture = new Texture(Gdx.files.internal("badlogic.jpg"));
imgTexture.setWrap(Texture.TextureWrap.MirroredRepeat, Texture.TextureWrap.MirroredRepeat);
TextureRegion imgTextureRegion = new TextureRegion(imgTexture);
imgTextureRegion.setRegion(0,0,imgTexture.getWidth()*3,imgTexture.getHeight()*3);
Will give you this:
Below you can see the sample code that generated that picture using a Stage and Image Actor (Scene2D)
public class GameScreen implements Screen {
MyGdxGame game;
private Stage stage;
public GameScreen(MyGdxGame aGame){
stage = new Stage(new ScreenViewport());
game = aGame;
Texture imgTexture = new Texture(Gdx.files.internal("badlogic.jpg"));
imgTexture.setWrap(Texture.TextureWrap.MirroredRepeat, Texture.TextureWrap.MirroredRepeat);
TextureRegion imgTextureRegion = new TextureRegion(imgTexture);
imgTextureRegion.setRegion(0,0,imgTexture.getWidth()*3,imgTexture.getHeight()*3);
TextureRegionDrawable imgTextureRegionDrawable = new TextureRegionDrawable(imgTextureRegion);
Image img = new Image();
img.setDrawable(imgTextureRegionDrawable);
img.setSize(imgTexture.getWidth()*3,imgTexture.getHeight()*3);
stage.addActor(img);
}
@Override
public void show() {
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
stage.act(delta);
stage.draw();
}
@Override
public void resize(int width, int height) {
stage.getViewport().update(width, height, true);
}
@Override
public void pause() {
}
@Override
public void resume() {
}
@Override
public void hide() {
}
@Override
public void dispose() {
stage.dispose();
}
}