- Home /
Mirroring GUITexture While Preserving Rect.Contains()
Hello.
In working on an application, I have hit an unexpected snare. For part of my app's interactions with the user, I need to be displaying a GUITexture
on the screen. I check for interactions within the rectangle (both GetScreenRect()
and pixelInset
) via Contains(Vector2)
.
However, in order to mirror this GUITexture
across the y-axis, I set the width
on pixelInset
to a negative value and offset the x
accordingly. The display works perfectly, but now rect.Contains(Vector2)
no longer works.
Is it possible to achieve the effect or mirroring across any axis with a GUITexture
while maintaining rect.Contains(Vector2)
functionality?
If not, I am not opposed to doing the math. Just curious on if Unity has any integrated way of producing this effect without overhauling an older library I made.
Thank you!