Search Unity

guilayout window and scrollview - titlebar size, padding etc

Discussion in 'Immediate Mode GUI (IMGUI)' started by Ghidera, Apr 19, 2014.

  1. Ghidera

    Ghidera

    Joined:
    Mar 6, 2013
    Posts:
    53
    I've made a guilayout window with a scrollview containing a label which contains a big long string in it. What I'd like to do is size the window so that the clip area of the scrollview contains a specific number of lines of text based in the font size. something that would do the same as

    Code (csharp):
    1.  
    2. scrollView.innerHeight = theFontSize * 8 ;
    3.  
    Of course it can't be done that way. I know I have to size the window to get the scrollview the right size. I figure I need to know

    Window border size, window titlebar size, window bottom padding size, scrollview upper and lower padding size, label padding between lines.

    Where would I find these things? I can't really see anything in the docs but they must be a fixed size someplace.

    Thanks!
     
  2. Ghidera

    Ghidera

    Joined:
    Mar 6, 2013
    Posts:
    53
    I had a look at gui.skin.xxx.margin for windows but it was all zeros in the rect. I experimented a bunch and I think I have it figured out.

    Top and bottom border/padding etc is 40 and the line spacing in a label is 2.