LineHeight in GUIStyle is ‘Read Only’. Why?
How can I set the lineheight, either in the editor, or via a script?
Thanks
~ce
LineHeight in GUIStyle is ‘Read Only’. Why?
How can I set the lineheight, either in the editor, or via a script?
Thanks
~ce
Is this something I should post in the “Wish”-section?
yeah it would be nice if all font specs were editable. a workaround here:
http://forum.unity3d.com/viewtopic.php?t=13536
: )
Thanks for the tip about TypeTool. For my purpose I think it’s easier to split the string at line breaks and render each line separately.
If someone encouter same problem, you can use GUILayoutOption to set height on a GUILayout item :
var lineHeight = 200;
var myLayout = new GUILayoutOption[] {
GUILayout.Height(lineHeight)
};
var labelStyle = new GUIStyle();
GUILayout.Label(currentValue, labelStyle, myLayout );
You can also simplify it and write directly:
GUILayout.Label(currentValue, labelStyle, GUILayout.Height(lineHeight) );
–
Game Rules
Unified Visual Scripting Asset with rules engine
https://www.assetstore.unity3d.com/en/#!/content/84383
https://game-rules.net