コード例 #1
0
        // Weak links to children

        /** Update the layout of the stepper with the given touch location. */

        protected void UpdateLayoutUsingTouchLocation(CCPoint location)
        {
            if (location.X < _minusSprite.ContentSize.Width &&
                _value > _minimumValue)
            {
                _touchedPart = CCControlStepperPart.PartMinus;

                _minusSprite.Color = CCTypes.CCGray;
                _plusSprite.Color  = CCTypes.CCWhite;
            }
            else if (location.X >= _minusSprite.ContentSize.Width &&
                     _value < _maximumValue)
            {
                _touchedPart = CCControlStepperPart.PartPlus;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color  = CCTypes.CCGray;
            }
            else
            {
                _touchedPart = CCControlStepperPart.PartNone;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color  = CCTypes.CCWhite;
            }
        }
コード例 #2
0
        void OnTouchMoved(CCTouch pTouch, CCEvent touchEvent)
        {
            if (IsTouchInside(pTouch))
            {
                CCPoint location = GetTouchLocation(pTouch);
                UpdateLayoutUsingTouchLocation(location);

                if (!touchInsideFlag)
                {
                    touchInsideFlag = true;

                    if (autorepeat)
                    {
                        StartAutorepeat();
                    }
                }
            }
            else
            {
                touchInsideFlag = false;

                touchedPart = CCControlStepperPart.PartNone;

                MinusSprite.Color = CCColor3B.White;
                PlusSprite.Color  = CCColor3B.White;

                if (autorepeat)
                {
                    StopAutorepeat();
                }
            }
        }
コード例 #3
0
        public override void TouchMoved(CCTouch pTouch)
        {
            if (IsTouchInside(pTouch))
            {
                CCPoint location = GetTouchLocation(pTouch);
                UpdateLayoutUsingTouchLocation(location);

                if (!_touchInsideFlag)
                {
                    _touchInsideFlag = true;

                    if (_autorepeat)
                    {
                        StartAutorepeat();
                    }
                }
            }
            else
            {
                _touchInsideFlag = false;

                _touchedPart = CCControlStepperPart.PartNone;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color  = CCTypes.CCWhite;

                if (_autorepeat)
                {
                    StopAutorepeat();
                }
            }
        }
コード例 #4
0
        /** Update the layout of the stepper with the given touch location. */

        protected void UpdateLayoutUsingTouchLocation(CCPoint location)
        {
            if (location.X < MinusSprite.ContentSize.Width &&
                this.value > minimumValue)
            {
                touchedPart = CCControlStepperPart.PartMinus;

                MinusSprite.Color = CCColor3B.Gray;
                PlusSprite.Color  = CCColor3B.White;
            }
            else if (location.X >= MinusSprite.ContentSize.Width &&
                     this.value < maximumValue)
            {
                touchedPart = CCControlStepperPart.PartPlus;

                MinusSprite.Color = CCColor3B.White;
                PlusSprite.Color  = CCColor3B.Gray;
            }
            else
            {
                touchedPart = CCControlStepperPart.PartNone;

                MinusSprite.Color = CCColor3B.White;
                PlusSprite.Color  = CCColor3B.White;
            }
        }
コード例 #5
0
ファイル: CCControlStepper.cs プロジェクト: h7ing/CocosSharp
		void OnTouchMoved(CCTouch pTouch, CCEvent touchEvent)
        {
            if (IsTouchInside(pTouch))
            {
                CCPoint location = GetTouchLocation(pTouch);
                UpdateLayoutUsingTouchLocation(location);

                if (!touchInsideFlag)
                {
                    touchInsideFlag = true;

                    if (autorepeat)
                    {
                        StartAutorepeat();
                    }
                }
            }
            else
            {
                touchInsideFlag = false;

                touchedPart = CCControlStepperPart.PartNone;

                MinusSprite.Color = CCColor3B.White;
                PlusSprite.Color = CCColor3B.White;

                if (autorepeat)
                {
                    StopAutorepeat();
                }
            }
        }
コード例 #6
0
ファイル: CCControlStepper.cs プロジェクト: h7ing/CocosSharp
		/** Update the layout of the stepper with the given touch location. */

		protected void UpdateLayoutUsingTouchLocation(CCPoint location)
		{
			if (location.X < MinusSprite.ContentSize.Width
				&& this.value > minimumValue)
			{
				touchedPart = CCControlStepperPart.PartMinus;

				MinusSprite.Color = CCColor3B.Gray;
				PlusSprite.Color = CCColor3B.White;
			}
			else if (location.X >= MinusSprite.ContentSize.Width
				&& this.value < maximumValue)
			{
				touchedPart = CCControlStepperPart.PartPlus;

				MinusSprite.Color = CCColor3B.White;
				PlusSprite.Color = CCColor3B.Gray;
			}
			else
			{
				touchedPart = CCControlStepperPart.PartNone;

				MinusSprite.Color = CCColor3B.White;
				PlusSprite.Color = CCColor3B.White;
			}
		}
コード例 #7
0
        // Weak links to children

        /** Update the layout of the stepper with the given touch location. */

        protected void UpdateLayoutUsingTouchLocation(CCPoint location)
        {
            if (location.X < _minusSprite.ContentSize.Width
                && _value > _minimumValue)
            {
                _touchedPart = CCControlStepperPart.PartMinus;

                _minusSprite.Color = CCTypes.CCGray;
                _plusSprite.Color = CCTypes.CCWhite;
            }
            else if (location.X >= _minusSprite.ContentSize.Width
                     && _value < _maximumValue)
            {
                _touchedPart = CCControlStepperPart.PartPlus;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color = CCTypes.CCGray;
            }
            else
            {
                _touchedPart = CCControlStepperPart.PartNone;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color = CCTypes.CCWhite;
            }
        }
コード例 #8
0
        public override void TouchMoved(CCTouch pTouch)
        {
            if (IsTouchInside(pTouch))
            {
                CCPoint location = GetTouchLocation(pTouch);
                UpdateLayoutUsingTouchLocation(location);

                if (!_touchInsideFlag)
                {
                    _touchInsideFlag = true;

                    if (_autorepeat)
                    {
                        StartAutorepeat();
                    }
                }
            }
            else
            {
                _touchInsideFlag = false;

                _touchedPart = CCControlStepperPart.PartNone;

                _minusSprite.Color = CCTypes.CCWhite;
                _plusSprite.Color = CCTypes.CCWhite;

                if (_autorepeat)
                {
                    StopAutorepeat();
                }
            }
        }