ScriptReference/GUILayoutUtility.GetRect #124
Replies: 2 comments
-
|
Comment by RobD6: If used in an EditorGUI (and possible non-editor too), the "Fixed" sized version of this (where you specify min and max) seems to happily overshoot the max width, instead expanding to the width of the space it's in. Adding |
Beta Was this translation helpful? Give feedback.
-
|
During the Layout event, this returns Rect rectViewport = Rect.zero;
void OnGUI() {
// GetRect has to be called in Layout still, not just repaint:
Rect r = GUILayoutUtility.GetRect( GUIContent.none, EditorStyles.textArea );
if( Event.current.type == EventType.Repaint )
rectViewport = r; // cache
GUILayout.BeginArea( rectViewport, EditorStyles.textArea );
// wow inside an area
GUILayout.EndArea();
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/GUILayoutUtility.GetRect
https://docs.unity3d.com/ScriptReference/GUILayoutUtility.GetRect.html
Beta Was this translation helpful? Give feedback.
All reactions