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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Editor Window Width issue

Discussion in 'Scripting' started by UnityLighting, Nov 1, 2017.

  1. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,793
    hi all

    i couldn't find any solution to fit my window elements inside my editor window's area

    How can i place all elements into my window's area without horizontal scroll bar ?

    Code (CSharp):
    1. scrollPos = EditorGUILayout.BeginScrollView (scrollPos,
    2.             false,
    3.             false,
    4.             GUILayout.Width (this.position.width),
    5.             GUILayout.Height (this.position.height));
    6.  
    Code (CSharp):
    1.         if (GUILayout.Button ("Refresh", buttonMain, GUILayout.Width (EditorGUIUtility.currentViewWidth), GUILayout.Height (20f))) {
    2.  
    Code (CSharp):
    1.             GUILayout.BeginVertical ("Box");
    2.  
     

    Attached Files:

  2. skinner92

    skinner92

    Joined:
    Feb 23, 2014
    Posts:
    112
    Did you try increasing your screen resolution?
     
    UnityLighting likes this.
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,793
    Fixed by removing this :
    EditorGUIUtility.currentViewWidth