FairyGUI.GTextField.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("font");
            if (str != null)
                _textFormat.font = str;

            str = xml.GetAttribute("fontSize");
            if (str != null)
                _textFormat.size = int.Parse(str);

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

            str = xml.GetAttribute("align");
            if (str != null)
                this.align = FieldTypes.ParseAlign(str);

            str = xml.GetAttribute("vAlign");
            if (str != null)
                this.verticalAlign = FieldTypes.ParseVerticalAlign(str);

            str = xml.GetAttribute("leading");
            if (str != null)
                _textFormat.lineSpacing = int.Parse(str);

            str = xml.GetAttribute("letterSpacing");
            if (str != null)
                _textFormat.letterSpacing = int.Parse(str);

            _ubbEnabled = xml.GetAttributeBool("ubb", false);

            str = xml.GetAttribute("autoSize");
            if (str != null)
                this.autoSize = FieldTypes.ParseAutoSizeType(str);

            _textFormat.underline = xml.GetAttributeBool("underline", false);
            _textFormat.italic = xml.GetAttributeBool("italic", false);
            _textFormat.bold = xml.GetAttributeBool("bold", false);
            this.singleLine = xml.GetAttributeBool("singleLine", false);
            str = xml.GetAttribute("strokeColor");
            if (str != null)
            {
                this.strokeColor = ToolSet.ConvertFromHtmlColor(str);
                this.stroke = xml.GetAttributeInt("strokeSize", 1);
            }

            str = xml.GetAttribute("shadowColor");
            if (str != null)
            {
                this.strokeColor = ToolSet.ConvertFromHtmlColor(str);
                this.shadowOffset = xml.GetAttributeVector("shadowOffset");
            }
        }

Usage Example

 static public int Setup_BeforeAdd(IntPtr l)
 {
     try {
         FairyGUI.GTextField self = (FairyGUI.GTextField)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.GTextField::Setup_BeforeAdd