Example #1
0
        public static GUIStyle Alignment(this GUIStyle current, string value, bool asCopy = true)
        {
            value = value.ToLower();
            TextAnchor anchor = current.alignment;

            if (value == "upperleft")
            {
                anchor = TextAnchor.UpperLeft;
            }
            if (value == "uppercenter")
            {
                anchor = TextAnchor.UpperCenter;
            }
            if (value == "upperright")
            {
                anchor = TextAnchor.UpperRight;
            }
            if (value == "middleleft")
            {
                anchor = TextAnchor.MiddleLeft;
            }
            if (value == "middlecenter")
            {
                anchor = TextAnchor.MiddleCenter;
            }
            if (value == "middleright")
            {
                anchor = TextAnchor.MiddleRight;
            }
            if (value == "lowerleft")
            {
                anchor = TextAnchor.LowerLeft;
            }
            if (value == "lowercenter")
            {
                anchor = TextAnchor.LowerCenter;
            }
            if (value == "lowerright")
            {
                anchor = TextAnchor.LowerRight;
            }
            return(current.Alignment(anchor, asCopy));
        }