public override void OnEnter()
        {
            base.OnEnter();

            CCSize s = CCDirector.SharedDirector.WinSize;

            CCProgressTo to   = new CCProgressTo(6, 100);
            CCAction     tint = new CCSequence(new CCTintTo(1, 255, 0, 0),
                                               new CCTintTo(1, 0, 255, 0),
                                               new CCTintTo(1, 0, 0, 255));
            CCAction 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.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));
        }
Esempio n. 2
0
        public StressTest2()
        {
            CCSize s = CCDirector.SharedDirector.WinSize;

            CCLayer sublayer = new CCLayer();

            CCSprite sp1 = new CCSprite(TestResource.s_pPathSister1);

            sp1.Position = (new CCPoint(80, s.Height / 2));

            CCActionInterval move             = new CCMoveBy(3, new CCPoint(350, 0));
            CCActionInterval move_ease_inout3 = new CCEaseInOut((CCActionInterval)(move.Copy()), 2.0f);
            var move_ease_inout_back3         = (CCActionInterval)move_ease_inout3.Reverse();
            CCFiniteTimeAction seq3           = new CCSequence(move_ease_inout3, move_ease_inout_back3);

            sp1.RunAction(new CCRepeatForever((CCActionInterval)seq3));
            sublayer.AddChild(sp1, 1);

            CCParticleFire fire = new CCParticleFire();

            fire.Texture  = (CCTextureCache.SharedTextureCache.AddImage("Images/fire"));
            fire.Position = (new CCPoint(80, s.Height / 2 - 50));

            var copy_seq3 = (CCActionInterval)(seq3.Copy());

            fire.RunAction(new CCRepeatForever(copy_seq3));
            sublayer.AddChild(fire, 2);

            Schedule((shouldNotLeak), 6.0f);

            AddChild(sublayer, 0, CocosNodeTestStaticLibrary.kTagSprite1);
        }
Esempio n. 3
0
        private void RunIntroAnimations()
        {
            var scale = 1f;

#if WINDOWS_PHONE || ANDROID
            scale = 0.6f;
#endif
            var scaleAndFadeButtons = new CCSequence(new CCDelayTime(0.3f), new CCFadeIn(0.05f), new CCScaleTo(0.5f, scale));
            var scaleAndFadeLogo    = new CCSequence(new CCDelayTime(0.3f), new CCFadeIn(0.05f), new CCScaleTo(0.5f, 0.5f));
            _logo.RunAction(scaleAndFadeLogo);
            foreach (var item in _buttonsMenu.Children)
            {
                var sequence = scaleAndFadeButtons.Copy();
                item.RunAction(sequence);
            }
        }