Esempio n. 1
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to1 = new CCProgressTo(2, 100);
            CCProgressTo to2 = new CCProgressTo(2, 100);

            CCProgressTimer left = new CCProgressTimer(s_pPathSister1);

            left.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the left since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0, 0);
            //    Setup for a horizontal bar since the bar change rate is 0 for y meaning no horizontaly change
            left.BarChangeRate = new CCPoint(0, 1);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever(to1));

            CCProgressTimer right = new CCProgressTimer(s_pPathSister2);

            right.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the left since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0, 1);
            //    Setup for a horizontal bar since the bar change rate is 0 for y meaning no horizontaly change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever(to2));
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo action = new CCProgressTo(2, 100);

            /**
             *  Our image on the left should be a radial progress indicator, clockwise
             */
            CCProgressTimer left = new CCProgressTimer(new CCSprite(s_pPathBlock));

            left.Type = CCProgressTimerType.Radial;
            AddChild(left);
            left.Midpoint = new CCPoint(0.25f, 0.75f);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever((CCActionInterval)action.Copy()));

            /**
             *  Our image on the left should be a radial progress indicator, counter clockwise
             */
            CCProgressTimer right = new CCProgressTimer(new CCSprite(s_pPathBlock));

            right.Type     = CCProgressTimerType.Radial;
            right.Midpoint = new CCPoint(0.75f, 0.25f);

            /**
             *  Note the reverse property (default=NO) is only added to the right image. That's how
             *  we get a counter clockwise progress.
             */
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever((CCActionInterval)action.Copy()));
        }
Esempio n. 3
0
        /// <summary>
        /// Creates and initializes with a duration and a percent
        /// </summary>
        public static CCProgressTo Create(float duration, float fPercent)
        {
            var pProgressTo = new CCProgressTo();
            pProgressTo.InitWithDuration(duration, fPercent);

            return pProgressTo;
        }
Esempio n. 4
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            var progressTo = new CCProgressTo(2, 100);

            /**
             *  Our image on the left should be a radial progress indicator, clockwise
             */
            CCProgressTimer left = new CCProgressTimer(new CCSprite(s_pPathBlock));

            left.Type = CCProgressTimerType.Radial;
            AddChild(left);
            left.Midpoint = new CCPoint(0.25f, 0.75f);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RepeatForever(progressTo);

            /**
             *  Our image on the left should be a radial progress indicator, counter clockwise
             */
            CCProgressTimer right = new CCProgressTimer(new CCSprite(s_pPathBlock));

            right.Type     = CCProgressTimerType.Radial;
            right.Midpoint = new CCPoint(0.75f, 0.25f);

            /**
             *  Note the reverse property (default=NO) is only added to the right image. That's how
             *  we get a counter clockwise progress.
             */
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RepeatForever(progressTo);
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            var progressTo = new CCProgressTo(2, 100);

            CCProgressTimer left = new CCProgressTimer(s_pPathSister1);

            left.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the left since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0, 0);
            //    Setup for a horizontal bar since the bar change rate is 0 for y meaning no horizontaly change
            left.BarChangeRate = new CCPoint(0, 1);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RepeatForever(progressTo);

            CCProgressTimer right = new CCProgressTimer(s_pPathSister2);

            right.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the left since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0, 1);
            //    Setup for a horizontal bar since the bar change rate is 0 for y meaning no horizontaly change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RepeatForever(progressTo);
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to   = new CCProgressTo(6, 100);
            CCAction     tint = CCSequence.FromActions(new CCTintTo(1, 255, 0, 0),
                                                       new CCTintTo(1, 0, 255, 0),
                                                       new CCTintTo(1, 0, 0, 255));
            CCAction fade = CCSequence.FromActions(new CCFadeTo(1.0f, 0),
                                                   new CCFadeTo(1.0f, 255));

            CCProgressTimer left = new CCProgressTimer(new CCSprite(s_pPathSister1));

            left.Type = CCProgressTimerType.Bar;

            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            left.BarChangeRate = new CCPoint(1, 0);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));
            left.RunAction(new CCRepeatForever((CCActionInterval)tint.Copy()));

            left.AddChild(new CCLabelTTF("Tint", "arial", 20.0f));

            CCProgressTimer middle = new CCProgressTimer(new CCSprite(s_pPathSister2));

            middle.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            middle.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            middle.BarChangeRate = new CCPoint(1, 1);
            AddChild(middle);
            middle.Position = new CCPoint(s.Width / 2, s.Height / 2);
            middle.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));
            middle.RunAction(new CCRepeatForever((CCActionInterval)fade.Copy()));

            middle.AddChild(new CCLabelTTF("Fade", "arial", 20.0f));

            CCProgressTimer right = new CCProgressTimer(new CCSprite(s_pPathSister2));

            right.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));
            right.RunAction(new CCRepeatForever((CCActionInterval)tint.Copy()));
            right.RunAction(new CCRepeatForever((CCActionInterval)fade.Copy()));

            right.AddChild(new CCLabelTTF("Tint and Fade", "arial", 20.0f));
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            var progressTo = new CCProgressTo(6, 100);
            var tint       = new CCSequence(new CCTintTo(1, 255, 0, 0),
                                            new CCTintTo(1, 0, 255, 0),
                                            new CCTintTo(1, 0, 0, 255));
            var fade = new CCSequence(new CCFadeTo(1.0f, 0),
                                      new CCFadeTo(1.0f, 255));

            CCProgressTimer left = new CCProgressTimer(new CCSprite(s_pPathSister1));

            left.Type = CCProgressTimerType.Bar;

            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            left.BarChangeRate = new CCPoint(1, 0);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RepeatForever(progressTo);
            left.RepeatForever(tint);

            left.AddChild(new CCLabel("Tint", "arial", 20.0f, CCLabelFormat.SpriteFont));

            CCProgressTimer middle = new CCProgressTimer(new CCSprite(s_pPathSister2));

            middle.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            middle.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            middle.BarChangeRate = new CCPoint(1, 1);
            AddChild(middle);
            middle.Position = new CCPoint(s.Width / 2, s.Height / 2);
            middle.RepeatForever(progressTo);
            middle.RepeatForever(fade);

            middle.AddChild(new CCLabel("Fade", "arial", 20.0f, CCLabelFormat.SpriteFont));

            CCProgressTimer right = new CCProgressTimer(new CCSprite(s_pPathSister2));

            right.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RepeatForever(progressTo);
            right.RepeatForever(tint);
            right.RepeatForever(fade);

            right.AddChild(new CCLabel("Tint and Fade", "arial", 20.0f, CCLabelFormat.SpriteFont));
        }
Esempio n. 8
0
 public CCProgressToState (CCProgressTo action, CCNode target)
     : base (action, target)
 { 
     PercentTo = action.PercentTo;
     PercentFrom = ((CCProgressTimer)(target)).Percentage;
     // XXX: Is this correct ?
     // Adding it to support CCRepeat
     if (PercentFrom == 100)
     {
         PercentFrom = 0;
     }
 }
Esempio n. 9
0
 public CCProgressToState(CCProgressTo action, CCNode target)
     : base(action, target)
 {
     PercentTo   = action.PercentTo;
     PercentFrom = ((CCProgressTimer)(target)).Percentage;
     // XXX: Is this correct ?
     // Adding it to support CCRepeat
     if (PercentFrom == 100)
     {
         PercentFrom = 0;
     }
 }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            var progressTo = new CCProgressTo(6, 100);

            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFrames("zwoptex/grossini.plist");

            CCSprite sprite = new CCSprite("grossini_dance_01.png");

            CCProgressTimer left = new CCProgressTimer(sprite);

            left.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            left.BarChangeRate = new CCPoint(1, 0);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RepeatForever(progressTo);

            CCProgressTimer middle = new CCProgressTimer(new CCSprite("grossini_dance_02.png"));

            middle.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            middle.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            middle.BarChangeRate = new CCPoint(1, 1);
            AddChild(middle);
            middle.Position = new CCPoint(s.Width / 2, s.Height / 2);
            middle.RepeatForever(progressTo);

            CCProgressTimer right = new CCProgressTimer(new CCSprite("grossini_dance_03.png"));

            right.Type = CCProgressTimerType.Radial;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RepeatForever(progressTo);
        }
Esempio n. 11
0
        protected override void StartProgressLine()
        {
            if (_isTimerStarted)
            {
                return;
            }
            _isTimerStarted = true;

            StopProgressLine();

            var progressTo = new CCProgressTo(_gameTime, 100);

            var        moveCompletedAction = new CCCallFunc(GameFinished);
            CCSequence mySequence          = new CCSequence(progressTo, moveCompletedAction);

            _progressTimer.Percentage = .0f;
            _progressTimer.Repeat(1, mySequence);
        }
Esempio n. 12
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to = new CCProgressTo(6, 100);

            CCSpriteFrameCache.SharedSpriteFrameCache.AddSpriteFramesWithFile("zwoptex/grossini.plist");

            CCProgressTimer left = new CCProgressTimer(new CCSprite("grossini_dance_01.png"));

            left.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            left.BarChangeRate = new CCPoint(1, 0);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));

            CCProgressTimer middle = new CCProgressTimer(new CCSprite("grossini_dance_02.png"));

            middle.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            middle.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            middle.BarChangeRate = new CCPoint(1, 1);
            AddChild(middle);
            middle.Position = new CCPoint(s.Width / 2, s.Height / 2);
            middle.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));

            CCProgressTimer right = new CCProgressTimer(new CCSprite("grossini_dance_03.png"));

            right.Type = CCProgressTimerType.Radial;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));
        }
Esempio n. 13
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to = new CCProgressTo(2, 100);

            CCProgressTimer left = new CCProgressTimer(new CCSprite(s_pPathSister1));

            left.Type = CCProgressTimerType.Bar;

            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            left.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            left.BarChangeRate = new CCPoint(1, 0);
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));

            CCProgressTimer middle = new CCProgressTimer(new CCSprite(s_pPathSister2));

            middle.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            middle.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            middle.BarChangeRate = new CCPoint(1, 1);
            AddChild(middle);
            middle.Position = new CCPoint(s.Width / 2, s.Height / 2);
            middle.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));

            CCProgressTimer right = new CCProgressTimer(new CCSprite(s_pPathSister2));

            right.Type = CCProgressTimerType.Bar;
            //    Setup for a bar starting from the bottom since the midpoint is 0 for the y
            right.Midpoint = new CCPoint(0.5f, 0.5f);
            //    Setup for a vertical bar since the bar change rate is 0 for x meaning no horizontal change
            right.BarChangeRate = new CCPoint(0, 1);
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever((CCActionInterval)to.Copy()));
        }
Esempio n. 14
0
        public override object Copy(ICopyable pZone)
        {
            CCProgressTo pCopy;
            if (pZone != null)
            {
                //in case of being called at sub class
                pCopy = (CCProgressTo) (pZone);
            }
            else
            {
                pCopy = new CCProgressTo();
                pZone =  (pCopy);
            }

            base.Copy(pZone);

            pCopy.InitWithDuration(m_fDuration, m_fTo);

            return pCopy;
        }
Esempio n. 15
0
        public override object Copy(ICCCopyable pZone)
        {
            CCProgressTo pCopy;

            if (pZone != null)
            {
                //in case of being called at sub class
                pCopy = (CCProgressTo)(pZone);
            }
            else
            {
                pCopy = new CCProgressTo();
                pZone = (pCopy);
            }

            base.Copy(pZone);

            pCopy.InitWithDuration(m_fDuration, m_fTo);

            return(pCopy);
        }
        public override void onEnter()
        {
            base.onEnter();

            CCSize s = CCDirector.sharedDirector().getWinSize();

            CCProgressTo to1 = CCProgressTo.actionWithDuration(2, 100);
            CCProgressTo to2 = CCProgressTo.actionWithDuration(2, 100);

            CCProgressTimer left = CCProgressTimer.progressWithFile(s_pPathSister1);

            left.Type = CCProgressTimerType.kCCProgressTimerTypeRadialCW;
            addChild(left);
            left.position = new CCPoint(100, s.height / 2);
            left.runAction(CCRepeatForever.actionWithAction(to1));

            CCProgressTimer right = CCProgressTimer.progressWithFile(s_pPathBlock);

            right.Type = CCProgressTimerType.kCCProgressTimerTypeRadialCCW;
            addChild(right);
            right.position = new CCPoint(s.width - 100, s.height / 2);
            right.runAction(CCRepeatForever.actionWithAction(to2));
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            var progressTo = new CCProgressTo(2, 100);

            CCProgressTimer left = new CCProgressTimer(s_pPathSister1);

            left.Type = CCProgressTimerType.Radial;
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RepeatForever(progressTo);

            CCProgressTimer right = new CCProgressTimer(s_pPathBlock);

            right.Type             = CCProgressTimerType.Radial;
            right.ReverseDirection = true;
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RepeatForever(progressTo);
        }
        public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to1 = new CCProgressTo(2, 100);
            CCProgressTo to2 = new CCProgressTo(2, 100);

            CCProgressTimer left = new CCProgressTimer(s_pPathSister1);

            left.Type = CCProgressTimerType.Radial;
            AddChild(left);
            left.Position = new CCPoint(100, s.Height / 2);
            left.RunAction(new CCRepeatForever(to1));

            CCProgressTimer right = new CCProgressTimer(s_pPathBlock);

            right.Type            = CCProgressTimerType.Radial;
            right.ReverseProgress = true;
            AddChild(right);
            right.Position = new CCPoint(s.Width - 100, s.Height / 2);
            right.RunAction(new CCRepeatForever(to2));
        }