I want to control the width of a GUILayout Texture2D.
I tried to do this by GUILayout.Width;
But this also scales the hight even when i give a absolute hight with it.
So maybe this can be done, but for some reason it's not.
i also tried this:
that doesnt work either.
I cannot use GUI.Box because i want it to be in the top-left part of the screen, even if resized. can someone explain me what i'm doing worng?? Thanks
asked Sep 17 '10 at 01:50 PM
You can still use GUI.Box (or GUI.DrawTexture would be better) and have it scale to the screen resolution. Just do this:
This way the texture will always be 10% of the screen width across. You can use any kind of equation you want with Screen.width if that's not where you want it.
If you wanted it flush with the corner then it'd be Rect(0,0,100,100)
answered Sep 17 '10 at 04:46 PM