How can I flip the texture of a sprite along the x axis?

I need to flip a sprite texture in the scene.
According to here, I should be able to set the scale to -1 in the direction that is needed to flip (x)
I wrote 2 examples that load a sprite with a texture

  • In the first case the scale is set to (1000, 1000, 1)
  • In the second case the scale is set to (-1000, 1000, 1)

In the second case scale.x is negated so I expect the image to be flipped (mirrored) on the x axis, but the image still looks the same as in the first case.
How can I flip the texture of the sprite along the x axis?


EDIT: I found out that I can flip the image by using flipY (I did not find flipX) and rotating the image by 180 degrees. See the third example.
Is this an acceptable way to flip the image?

Thanks,
Avner

1 Like

/cc

1 Like