예제 #1
0
        override protected void ConstructExtension(ByteBuffer buffer)
        {
            buffer.Seek(0, 6);

            _titleType = (ProgressTitleType)buffer.ReadByte();
            _reverse   = buffer.ReadBool();

            _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);
        }
예제 #2
0
		override protected void ConstructExtension(ByteBuffer buffer)
		{
			buffer.Seek(0, 6);

			_titleType = (ProgressTitleType)buffer.ReadByte();
			_reverse = buffer.ReadBool();

			_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;
			}
		}
예제 #3
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);
        }
예제 #4
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);
            }
        }
예제 #5
0
        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();
        }
예제 #6
0
        public override 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;
            }
        }
예제 #7
0
        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);
            }
        }