- Home /
Question by
AngryOldMan · Feb 19, 2011 at 12:37 AM ·
guitextureaspect-ratio
Texture inside GUI
so i have a texture inside a GUI. I want it to resize on the X axis but be uneffected on the Y axis. Right now when the GUI decreases on along the X value the texture inside the GUI resizes to maintain its aspect ratio. How do i stop this so that it ignors the textures aspect ratio and resizes it on the X axis while the Y axis is fixed???
Comment
Best Answer
Answer by Fanboy · Feb 19, 2011 at 03:08 AM
Gui.DrawTexture has a parameter that allows you to specify how it scales:
http://unity3d.com/support/documentation/ScriptReference/GUI.DrawTexture.html
You'll want to use the ScaleMode.StretchToFill flag.
http://unity3d.com/support/documentation/ScriptReference/ScaleMode.StretchToFill.html
thank you very much, your answer worked perfectly, much appreciated.