Exemplo n.º 1
0
        private static float CalcMinWidth(GUIStyle style, string str, float redundant = 0)
        {
            float min, max;

            style.CalcMinMaxWidth(GUIContents.Temp1(str), out min, out max);
            return(min + redundant);
        }
Exemplo n.º 2
0
        private static Vector2 CalcMinSize(
            GUIStyle style, string str, float redundantWidth = 0, float redundantHeight = 0)
        {
            var size = style.CalcSize(GUIContents.Temp1(str));

            size.x += redundantWidth;
            size.y += redundantHeight;
            return(size);
        }
Exemplo n.º 3
0
        public static bool ImageButton(Texture2D image, float width, float height)
        {
            var rect = GUILayoutUtility.GetRect(width, height, GUILayout.Width(width), GUILayout.Height(height));

            return(GUI.Button(rect, GUIContents.Temp1(image), EditorStylesEx.ImageButton));
        }