- Home /
Stretchable textures in Editor
I am trying to create a bar that you can stretch horizontally, but not vertically, in an EditorWindow. I am trying to use GUILayout to draw the texture, but whatever I try, whenever I manage to change its width, its height changes as well (it seems to hold on to its aspect ratio no matter what).
So to clarify: I have single image that I want to be able to stretch horizontally, so that I can achieve situations 1 and 2 in the image (or any other amount of stretch I would want).
I've tried GUIStyle.fixedHeight and Width, setting GUIStyle.stretchHeight to false, stretchWidth to true and passing GUILayout.width/height parameters in the GUILayout.Label()-function.
Is what I want possible with GUILayout or should I just use GUI.DrawTexture()?
Your answer
Follow this Question
Related Questions
EditorGUILayout.Foldout seems to stop working past indent 3 0 Answers
uGUI How do you mix Relative + Precision-pixel layouts? 2 Answers
Custom inspector - disabling specific controls. 1 Answer
Get height of a group of GUILayout controls 1 Answer
Space for describing text in EditorGUILayout too short 1 Answer