Search Unity

GUI flickering

Discussion in 'Immediate Mode GUI (IMGUI)' started by JohnGalt, Feb 5, 2008.

  1. JohnGalt

    JohnGalt

    Joined:
    Nov 27, 2007
    Posts:
    85
    I have a question with the GUILayout.Window function.

    Option 1:

    GUILayout.Window(0, mDebugRect, MakeDebugWindow, "Debug Window");

    Option 2:

    mDebugRect = GUILayout.Window(0, mDebugRect, MakeDebugWindow, "Debug Window");

    Why with option 1 I get flickering if for example I click on the window?

    It seems that it is compulsory the next time you call the function to use the return value rect.
     
  2. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
  3. JohnGalt

    JohnGalt

    Joined:
    Nov 27, 2007
    Posts:
    85
    Yes, the example does exactly that, but in no place it specifies that it is compulsory to pass the Rect back.

    In fact, I assumed that the return Rect was used for the user to get the actual size the Window function has calculated and used, so that the user can take any action like repositioning based on this size.