FairyGUI.GLoader.Setup_BeforeAdd C# (CSharp) Method

Setup_BeforeAdd() public method

public Setup_BeforeAdd ( XML xml ) : void
xml FairyGUI.Utils.XML
return void
        public override 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";

            str = xml.GetAttribute("frame");
            if (str != null)
                _content.currentFrame = int.Parse(str);
            _content.playing = xml.GetAttributeBool("playing", true);

            str = xml.GetAttribute("color");
            if (str != null)
                _content.color = ToolSet.ConvertFromHtmlColor(str);

            str = xml.GetAttribute("fillMethod");
            if (str != null)
                _content.fillMethod = FieldTypes.ParseFillMethod(str);

            if (_content.fillMethod != FillMethod.None)
            {
                _content.fillOrigin = xml.GetAttributeInt("fillOrigin");
                _content.fillClockwise = xml.GetAttributeBool("fillClockwise", true);
                _content.fillAmount = (float)xml.GetAttributeInt("fillAmount", 100) / 100;
            }

            if (_url != null)
                LoadContent();
        }

Usage Example

 static public int Setup_BeforeAdd(IntPtr l)
 {
     try {
         FairyGUI.GLoader   self = (FairyGUI.GLoader)checkSelf(l);
         FairyGUI.Utils.XML a1;
         checkType(l, 2, out a1);
         self.Setup_BeforeAdd(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
All Usage Examples Of FairyGUI.GLoader::Setup_BeforeAdd