Search Unity

Guilayout.Window size issue

Discussion in 'Immediate Mode GUI (IMGUI)' started by jaguillard, Apr 2, 2012.

  1. jaguillard

    jaguillard

    Joined:
    Mar 1, 2011
    Posts:
    4
    I recently updated to Unity 3.5 and suddenly my GUILayout.Window has become a dot. The Window is in the right X-Y starting point, but the width and height are wrong. If I capture the return from the Window call, the area's width and height get reduced. I even tried different styles with no effect to sizing. If I force the style with a fixed width or height, the window will grow, but the items inside don't render.

    I'm not using any code to change the window's size, so I have no idea what's causing the shrinkage. This isn't affecting using BeginArea. Anyone have a clue what is happening?
     
  2. SimonAlkemade

    SimonAlkemade

    Joined:
    Feb 4, 2009
    Posts:
    432
    Can you post some of the code?
     
  3. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    did you by error put the window inside a group / area?
     
  4. jaguillard

    jaguillard

    Joined:
    Mar 1, 2011
    Posts:
    4
    If I comment out all my code and just put a single GUILayout.Window function call with a Rect(0, 0, 800, 600) and a visible skin, the Window is 0 pixels. If I grab the return, the area gets modified to have 0 width and height.

    However, I decided to try out using GUI.Window instead. It works normally.
     
  5. fjalla

    fjalla

    Joined:
    Nov 6, 2012
    Posts:
    73
    Old post, I know, but just for documentation, it does not matter a single bit what size you give to the Rect, GUILayout will calculate that automatically, depending what is inside the window. If nothing is there, of course the size will be Rect (X, X, 0, 0) (I don't think GUILayout changes the position, that's why X).

    Post code next time if you want more help.