FairyGUI.GGraph.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)
        {
            string str;
            string type = xml.GetAttribute("type");
            if (type != null && type != "empty")
            {
                _shape = new Shape();
                _shape.gOwner = this;
                displayObject = _shape;
            }

            base.Setup_BeforeAdd(xml);

            if (_shape != null)
            {
                int lineSize;
                str = xml.GetAttribute("lineSize");
                if (str != null)
                    lineSize = int.Parse(str);
                else
                    lineSize = 1;

                Color lineColor;
                str = xml.GetAttribute("lineColor");
                if (str != null)
                    lineColor = ToolSet.ConvertFromHtmlColor(str);
                else
                    lineColor = Color.black;

                Color fillColor;
                str = xml.GetAttribute("fillColor");
                if (str != null)
                    fillColor = ToolSet.ConvertFromHtmlColor(str);
                else
                    fillColor = Color.white;

                if (type == "rect")
                    DrawRect(this.width, this.height, lineSize, lineColor, fillColor);
                else
                    DrawEllipse(this.width, this.height, fillColor);
            }
        }

Usage Example

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