FairyGUI.GSlider.ConstructFromXML C# (CSharp) Method

ConstructFromXML() public method

public ConstructFromXML ( XML cxml ) : void
cxml FairyGUI.Utils.XML
return void
        public override void ConstructFromXML(XML cxml)
        {
            base.ConstructFromXML(cxml);

            XML xml = cxml.GetNode("Slider");

            string str;
            str = xml.GetAttribute("titleType");
            if (str != null)
                _titleType = FieldTypes.ParseProgressTitleType(str);
            else
                _titleType = ProgressTitleType.Percent;

            _titleObject = GetChild("title") as GTextField;
            _barObjectH = GetChild("bar");
            _barObjectV = GetChild("bar_v");
            _aniObject = GetChild("ani") as GMovieClip;
            _gripObject = GetChild("grip");

            if (_barObjectH != null)
            {
                _barMaxWidth = _barObjectH.width;
                _barMaxWidthDelta = this.width - _barMaxWidth;
            }
            if (_barObjectV != null)
            {
                _barMaxHeight = _barObjectV.height;
                _barMaxHeightDelta = this.height - _barMaxHeight;
            }

            if (_gripObject != null)
            {
                _gripObject.onTouchBegin.Add(__gripTouchBegin);
                _gripObject.onTouchEnd.Add(__gripTouchEnd);
            }
        }

Usage Example

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