|
I'm trying to use GUIStyle.CalcHeight with my own GUIStyle, for some multi-line wordwrapped labels. Normally the number comes out too short and the last line, or the bottom of a single line of text gets clipped. If I add a background texture then it seems like most of the time the height returned works fine. I don't want to just overflow the text, beause then it might overlap the next label down. It also doesn't seem to properly account for the font style being set to bold. Is there a way to get accurate height?
(comments are locked)
|

Try adding a background texture with one pixel and zero alpha.
At the moment I'm just multiplying the result by 1.2 and using that. Seems to work.
CalcHeight should work, although it did take some fiddling until I used it correctly. Can you show the code you're using with it?
Are you adding the border values for the style to the height returned by CalcHeight? I seem to remember having to do that at one time.