Esempio n. 1
0
        public void Hide()
        {
            //指定移动到最左边并超出屏幕
            CCMoveTo move = CCMoveTo.actionWithDuration(0.5f, new CCPoint(-CCDirector.sharedDirector().getWinSize().width, 0));

            //执行一个队列行为,当移动完成后就会调用HideAniCompled
            this.runAction(CCSequence.actionOneTwo(move, CCCallFunc.actionWithTarget(this, HideAniCompled)));
        }
Esempio n. 2
0
        public override void onEnter()
        {
            base.onEnter();

            alignSpritesLeft(1);

            m_grossini.visible = false;

            CCFiniteTimeAction action = CCSequence.actions(
                CCPlace.actionWithPosition(new CCPoint(200, 200)),
                CCShow.action(),
                CCMoveBy.actionWithDuration(1, new CCPoint(100, 0)),
                CCCallFunc.actionWithTarget(this, new SEL_CallFunc(callback1)),
                CCCallFuncN.actionWithTarget(this, new SEL_CallFuncN(callback2)),
                CCCallFuncND.actionWithTarget(this, new SEL_CallFuncND(callback3), (object)0xbebabeba));

            m_grossini.runAction(action);
        }
Esempio n. 3
0
        public override void onEnter()
        {
            base.onEnter();

            CCSprite child = CCSprite.spriteWithFile(s_pPathGrossini);

            child.position = (new CCPoint(200, 200));
            addChild(child, 1);

            //Sum of all action's duration is 1.5 second.
            child.runAction(CCRotateBy.actionWithDuration(1.5f, 90));
            child.runAction(CCSequence.actions(
                                CCDelayTime.actionWithDuration(1.4f),
                                CCFadeOut.actionWithDuration(1.1f))
                            );

            //After 1.5 second, self will be removed.
            runAction(CCSequence.actions(
                          CCDelayTime.actionWithDuration(1.4f),
                          CCCallFunc.actionWithTarget(this, (removeThis)))
                      );
        }
Esempio n. 4
0
        public override void onEnter()
        {
            base.onEnter();

            centerSprites(3);

            CCFiniteTimeAction action = CCSequence.actions(
                CCMoveBy.actionWithDuration(2, new CCPoint(200, 0)),
                CCCallFunc.actionWithTarget(this, new SEL_CallFunc(callback1)));

            CCFiniteTimeAction action2 = CCSequence.actions(
                CCScaleBy.actionWithDuration(2, 2),
                CCFadeOut.actionWithDuration(2),
                CCCallFuncN.actionWithTarget(this, new SEL_CallFuncN(callback2)));

            CCFiniteTimeAction action3 = CCSequence.actions(
                CCRotateBy.actionWithDuration(3, 360),
                CCFadeOut.actionWithDuration(2),
                CCCallFuncND.actionWithTarget(this, new SEL_CallFuncND(callback3), (object)0xbebabeba));

            m_grossini.runAction(action);
            m_tamara.runAction(action2);
            m_kathia.runAction(action3);
        }
Esempio n. 5
0
        public override void onEnter()
        {
            base.onEnter();

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

            CCLabelTTF l = CCLabelTTF.labelWithString("Should not crash", "Arial", 16);

            addChild(l);
            l.position = (new CCPoint(s.width / 2, 245));

            CCMoveBy         pMove     = CCMoveBy.actionWithDuration(2, new CCPoint(200, 0));
            CCCallFunc       pCallback = CCCallFunc.actionWithTarget(this, stopAction);
            CCActionInterval pSequence = (CCActionInterval)CCSequence.actions(pMove, pCallback);

            pSequence.tag = (int)KTag.kTagSequence;

            CCSprite pChild = CCSprite.spriteWithFile(s_pPathGrossini);

            pChild.position = (new CCPoint(200, 200));

            addChild(pChild, 1, kTagGrossini);
            pChild.runAction(pSequence);
        }