- Home /
Cutting off a GUITexture's texture
I am making a GUI interface, using actual objects and not OnGUI, when I want to make a background for a window for example, it'll be resized. The problem is that resizing the GUITexture also resizes the Texture itself, basically messing up all the pixels and squishing and/or bloating the image.
How can I be able to resize the GUITexture but not have any of that happening? For example, I could make a 5000x5000 image, put it on a GUITexture, and when I have to resize it, it won't stretch itself, but rather cut itself off.
I cannot think of a way to make this happen for a GUITexture. You can clip using:
Using a Quad or a Plane and adjusting the $$anonymous$$aterial.mainTextureOffset and $$anonymous$$aterial.mainTexureScale.
Using a Quad and adjusting the $$anonymous$$esh.uv array.
In theory you could do it for a GUITexture by manipulating the texture directly and trim$$anonymous$$g out the parts you don't want.