private static void OnWarningToolbar(int windowID) { GUIStyle style = SabreGUILayout.GetOverlayStyle(); Vector2 size = style.CalcSize(new GUIContent(warningMessage)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(warningMessage, style, GUILayout.Width(size.x)); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); }
private static void OnWarningToolbar(int windowID) { GUIStyle style = SabreGUILayout.GetOverlayStyle(); Vector2 size = style.CalcSize(new GUIContent(warningMessage)); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Box(warningMessage, style, GUILayout.Width(size.x)); //, GUILayout.Width(size.x + 30), GUILayout.Height(50)); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); // GUIStyle style = SabreGUILayout.FormatStyle(Color.black, 20, TextAnchor.MiddleCenter); // GUILayout.Label(warningMessage, style); // Rect rect = GUILayoutUtility.GetLastRect(); // rect.center -= Vector2.one; // style.normal.textColor = Color.red; // // GUI.Label(rect, warningMessage, style); }