# What does the TextureRegion.flip() method do?

I'm learning libgdx and don't understand the purpose of parameters passed to flip(boolean x, boolean y). For example, I have code like this:

texture = new Texture(Gdx.files.internal("data/texture.png"));
textureRegion = new TextureRegion(texture, 0, 0, 20, 20);
textureRegion.flip(false, false);


My TextureRegion is flipped when both parameters are true and not flipped when they are false. But why does it need two parameters when it could have only one? The documentation says nothing about that.

textureRegion.flip(false, false); this will keep the original image as it is.

textureRegion.flip(true,false) it will mirror the image as below.ie it will flip the original image horizontally and preserve its y direction.

textureRegion.flip(false,true) ; it will flip the original image vertically and preserve its x direction

textureRegion.flip(ture,true) ; it will flip the original image vertically and horizontally

The parameters control which axis the image will be flipped around; sometimes you only want to flip around one or the other axis, instead of both.

The first parameter, if true, causes the image to be flipped in the X direction (horizontal flip) The second parameter, if true, causes the image to be flipped in the Y direction (vertical flip).

If both are true, the image is flipped around both axes.