UnityEngine.GUILayout.Label C# (CSharp) Method

Label() public static method

public static Label ( GUIContent content ) : void
content GUIContent
return void
        public static void Label (GUIContent content, params GUILayoutOption[] options) { }
        public static void Label (Texture image, GUIStyle style, params GUILayoutOption[] options) { }

Same methods

GUILayout::Label ( GUIContent content, GUIStyle style ) : void
GUILayout::Label ( Texture image ) : void
GUILayout::Label ( Texture image, GUIStyle style ) : void
GUILayout::Label ( string text ) : void
GUILayout::Label ( string text, GUIStyle style ) : void

Usage Example

コード例 #1
0
        /// <summary>
        /// Draws a dummy GUI layout element and measures its rect.
        /// If the current event is not the repaint event, then use the backup rect reference.
        /// </summary>
        public static U.Rect FindLayoutAreaRect(ref U.Rect backupRect, int border = 0)
        {
            //DRAW DUMMY LAYOUT GROUP TO GET THE RECT FROM
            Gl.BeginVertical(Gl.MaxWidth(U.Screen.width), Gl.MaxHeight(U.Screen.height));
            Gl.Label("");             //<- layout dummy
            Gl.EndVertical();
            U.Rect _fieldRect = U.GUILayoutUtility.GetLastRect();

            //rect update handling (ignore dummy rect at layout event)
            if (U.Event.current.type != U.EventType.Repaint)
            {
                _fieldRect = backupRect;
            }
            else
            {
                backupRect = _fieldRect;
            }

            _fieldRect.x      += border;
            _fieldRect.y      += border;
            _fieldRect.width  -= border * 2;
            _fieldRect.height -= border * 2;

            return(_fieldRect);
        }
All Usage Examples Of UnityEngine.GUILayout::Label