FairyGUI.FieldTypes.ParseFillType C# (CSharp) Method

ParseFillType() public static method

public static ParseFillType ( string value ) : FillType
value string
return FillType
        public static FillType ParseFillType(string value)
        {
            switch (value)
            {
                case "none":
                    return FillType.None;
                case "scale":
                    return FillType.Scale;
                case "scaleMatchHeight":
                    return FillType.ScaleMatchHeight;
                case "scaleMatchWidth":
                    return FillType.ScaleMatchWidth;
                case "scaleFree":
                    return FillType.ScaleFree;
                default:
                    return FillType.None;
            }
        }

Usage Example

Example #1
0
        override public void Setup_BeforeAdd(XML xml)
        {
            base.Setup_BeforeAdd(xml);

            string str;

            str = xml.GetAttribute("url");
            if (str != null)
            {
                _url = str;
            }

            str = xml.GetAttribute("align");
            if (str != null)
            {
                _align = FieldTypes.ParseAlign(str);
            }

            str = xml.GetAttribute("vAlign");
            if (str != null)
            {
                _verticalAlign = FieldTypes.ParseVerticalAlign(str);
            }

            str = xml.GetAttribute("fill");
            if (str != null)
            {
                _fill = FieldTypes.ParseFillType(str);
            }

            _autoSize = xml.GetAttributeBool("autoSize", false);

            str = xml.GetAttribute("errorSign");
            if (str != null)
            {
                showErrorSign = str == "true";
            }

            _playing = xml.GetAttributeBool("playing", true);

            str = xml.GetAttribute("color");
            if (str != null)
            {
                this.color = ToolSet.ConvertFromHtmlColor(str);
            }

            if (_url != null)
            {
                LoadContent();
            }
        }
All Usage Examples Of FairyGUI.FieldTypes::ParseFillType