ParseProgressTitleType() public static method

public static ParseProgressTitleType ( string value ) : ProgressTitleType
value string
return ProgressTitleType
Example #1
0
        override public 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;
            }
            _reverse = xml.GetAttributeBool("reverse");

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

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

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

            onTouchBegin.Add(__barTouchBegin);
        }
Example #2
0
        override public 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.displayObject.onMouseDown.Add(__gripMouseDown);
            }
        }
        override public void ConstructFromXML(XML cxml)
        {
            base.ConstructFromXML(cxml);

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

            string str;

            str = xml.GetAttribute("titleType");
            if (str != null)
            {
                _titleType = FieldTypes.ParseProgressTitleType(str);
            }
            else
            {
                _titleType = ProgressTitleType.Percent;
            }
            _reverse = xml.GetAttributeBool("reverse", false);

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

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