Clip/Crop an image with UnityGUI?

Is there any way clip/crop an image with UnityGUI?

I have an image and I only want to show a certain part of it. - using GUI.DrawTexture or GUI.Label doesn’t work, because the image always gets scaled or stretched to fit. I tried adding the image as a background to a GUIStyle and have nothing in the foreground, but that gets stretched as well…

Anything I can do?

How about using a scrollview? I don’t know if your clipping changes during the game, but a scrollview should work fine.

DrawTexture calls do not get cropped by anything, but a GUIStyle render with a background image will be cropped by windows, scroll areas and areas.

You can use BeginGroup/EndGroup with one of the draw texture type GUI commands inside. That’ll do clipping.

thanks! I’ll try that…