- Home /
DrawTexture without stretching it
I know this question sounds a little noobie, but:
Is it possible to draw a texture using GUI.DrawTexture without stretching it? Just cutting the part of the texture that would not appear in this particular Rect.
Lets say a have a Rect like this one (0, 0, 100, 50). And I have a texture which has the resolution 128x128 and I want to put this texture in this rectangle, but I just want to display 100x50 of the image without making the image taller or whatever. Is this possible?
Hope I made my question clearly!
Thanks from now!
http://unity3d.com/support/documentation/ScriptReference/Scale$$anonymous$$ode.html? I haven't tried all the Scale$$anonymous$$odes, so I'm not sure one of them will work for this, but I think you want Scale$$anonymous$$ode.ScaleAndCrop
.