Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question How can I get GUILayout height?

Discussion in 'Immediate Mode GUI (IMGUI)' started by berabue, Nov 29, 2022.

  1. berabue

    berabue

    Joined:
    Mar 11, 2015
    Posts:
    1
    After starting the GUI area using the GUILayout.BeginArea function and closing the GUI area using the GUILayout.EndArea function, I want to know the size between the two.

    Code (CSharp):
    1.  
    2.         // position = (0.0, 0.0, 100, 100)
    3.         GUILayout.BeginArea(position);
    4.         GUILayout.Space(5.0f);
    5.  
    6.         if (GameEditorUtility.DrawHeader("File"))
    7.         {
    8.             DrawFileList();
    9.             GameEditorUtility.Button("Load", LoadFile);
    10.             GameEditorUtility.Button("New", NewFile);
    11.         }
    12.         GUILayout.EndArea();
    After using the GUILayout.EndArea function, the position value does not change.
     
    Last edited: Apr 27, 2023
  2. oscarAbraham

    oscarAbraham

    Joined:
    Jan 7, 2013
    Posts:
    431