Ejemplo n.º 1
0
        public Test6()
        {
            CCSprite sp1  = CCSprite.spriteWithFile(TestResource.s_pPathSister1);
            CCSprite sp11 = CCSprite.spriteWithFile(TestResource.s_pPathSister1);

            CCSprite sp2  = CCSprite.spriteWithFile(TestResource.s_pPathSister2);
            CCSprite sp21 = CCSprite.spriteWithFile(TestResource.s_pPathSister2);

            sp1.position = (CCF.CCPointMake(100, 160));
            sp2.position = (CCF.CCPointMake(380, 160));

            CCActionInterval rot      = CCRotateBy.actionWithDuration(2, 360);
            CCActionInterval rot_back = rot.reverse() as CCActionInterval;
            CCAction         forever1 = CCRepeatForever.actionWithAction(
                (CCActionInterval)(CCSequence.actions(rot, rot_back)));
            CCAction forever11 = (CCAction)(forever1.copy());

            CCAction forever2  = (CCAction)(forever1.copy());
            CCAction forever21 = (CCAction)(forever1.copy());

            addChild(sp1, 0, CocosNodeTestStaticLibrary.kTagSprite1);
            sp1.addChild(sp11);
            addChild(sp2, 0, CocosNodeTestStaticLibrary.kTagSprite2);
            sp2.addChild(sp21);

            sp1.runAction(forever1);
            sp11.runAction(forever11);
            sp2.runAction(forever2);
            sp21.runAction(forever21);

            schedule(new SEL_SCHEDULE(this.addAndRemove), 2.0f);
        }
Ejemplo n.º 2
0
        public override void onEnter()
        {
            base.onEnter();

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

            CCLabelTTF label = CCLabelTTF.labelWithString(title(), "Arial", 32);

            addChild(label, 1);
            label.position = (CCF.CCPointMake(s.width / 2, s.height - 50));

            string strSubtitle = subtitle();

            if (!string.IsNullOrEmpty(strSubtitle))
            {
                CCLabelTTF l = CCLabelTTF.labelWithString(strSubtitle, "Thonburi", 16);
                addChild(l, 1);
                l.position = (CCF.CCPointMake(s.width / 2, s.height - 80));
            }

            CCMenuItemImage item1 = CCMenuItemImage.itemFromNormalImage(TestResource.s_pPathB1, TestResource.s_pPathB2, this, new SEL_MenuHandler(this.backCallback));
            CCMenuItemImage item2 = CCMenuItemImage.itemFromNormalImage(TestResource.s_pPathR1, TestResource.s_pPathR2, this, new SEL_MenuHandler(this.restartCallback));
            CCMenuItemImage item3 = CCMenuItemImage.itemFromNormalImage(TestResource.s_pPathF1, TestResource.s_pPathF2, this, new SEL_MenuHandler(this.nextCallback));

            CCMenu menu = CCMenu.menuWithItems(item1, item2, item3);

            menu.position  = (CCF.CCPointZero);
            item1.position = (CCF.CCPointMake(s.width / 2 - 100, 30));
            item2.position = (CCF.CCPointMake(s.width / 2, 30));
            item3.position = (CCF.CCPointMake(s.width / 2 + 100, 30));

            addChild(menu, 1);
        }
Ejemplo n.º 3
0
        public Test4()
        {
            CCSprite sp1 = CCSprite.spriteWithFile(TestResource.s_pPathSister1);
            CCSprite sp2 = CCSprite.spriteWithFile(TestResource.s_pPathSister2);

            sp1.position = (CCF.CCPointMake(100, 160));
            sp2.position = (CCF.CCPointMake(380, 160));

            addChild(sp1, 0, 2);
            addChild(sp2, 0, 3);

            schedule(new SEL_SCHEDULE(this.delay2), 2.0f);
            schedule(new SEL_SCHEDULE(this.delay4), 4.0f);
        }
Ejemplo n.º 4
0
        public override void onEnter()
        {
            base.onEnter();

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

            CCSprite sp1 = CCSprite.spriteWithFile(TestResource.s_pPathSister1);
            CCSprite sp2 = CCSprite.spriteWithFile(TestResource.s_pPathSister2);
            CCSprite sp3 = CCSprite.spriteWithFile(TestResource.s_pPathSister1);
            CCSprite sp4 = CCSprite.spriteWithFile(TestResource.s_pPathSister2);

            sp1.position = (CCF.CCPointMake(100, s.height / 2));
            sp2.position = (CCF.CCPointMake(380, s.height / 2));
            addChild(sp1);
            addChild(sp2);

            sp3.scale = (0.25f);
            sp4.scale = (0.25f);

            sp1.addChild(sp3);
            sp2.addChild(sp4);

            CCActionInterval a1 = CCRotateBy.actionWithDuration(2, 360);
            CCActionInterval a2 = CCScaleBy.actionWithDuration(2, 2);

            CCAction action1 = CCRepeatForever.actionWithAction(
                (CCActionInterval)(CCSequence.actions(a1, a2, a2.reverse()))
                );
            CCAction action2 = CCRepeatForever.actionWithAction(
                (CCActionInterval)(CCSequence.actions(
                                       (CCActionInterval)(a1.copy()),
                                       (CCActionInterval)(a2.copy()),
                                       a2.reverse()))
                );

            sp2.anchorPoint = (CCF.CCPointMake(0, 0));

            sp1.runAction(action1);
            sp2.runAction(action2);
        }