Ejemplo n.º 1
0
        public static CCSequence actionOneTwo(CCFiniteTimeAction actionOne, CCFiniteTimeAction actionTwo)
        {
            CCSequence sequence = new CCSequence();
            sequence.initOneTwo(actionOne, actionTwo);

            return sequence;
        }
Ejemplo n.º 2
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize          winSize = CCDirector.sharedDirector().getWinSize();
            CCRenderTexture cCPoint = CCRenderTexture.renderTextureWithWidthAndHeight((int)winSize.width, (int)winSize.height);

            if (cCPoint == null)
            {
                return;
            }
            cCPoint.Sprite.anchorPoint = new CCPoint(0.5f, 0.5f);
            cCPoint.position           = new CCPoint(winSize.width / 2f, winSize.height / 2f);
            cCPoint.anchorPoint        = new CCPoint(0.5f, 0.5f);
            cCPoint.clear(0f, 0f, 0f, 1f);
            cCPoint.begin();
            this.m_pOutScene.visit();
            cCPoint.end();
            base.hideOutShowIn();
            CCProgressTimer cCProgressTimer = CCProgressTimer.progressWithTexture(cCPoint.Sprite.Texture);

            cCProgressTimer.Type        = this.radialType();
            cCProgressTimer.Percentage  = 100f;
            cCProgressTimer.position    = new CCPoint(winSize.width / 2f, winSize.height / 2f);
            cCProgressTimer.anchorPoint = new CCPoint(0.5f, 0.5f);
            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { CCProgressFromTo.actionWithDuration(this.m_fDuration, 100f, 0f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            cCProgressTimer.runAction(CCSequence.actions(cCFiniteTimeActionArray));
            this.addChild(cCProgressTimer, 2, 2147483647);
        }
Ejemplo n.º 3
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone tmpZone = zone;
            CCSequence ret = null;

            if (tmpZone != null && tmpZone.m_pCopyObject != null)
            {
                ret = tmpZone.m_pCopyObject as CCSequence;
                if (ret == null)
                {
                    return null;
                }
            }
            else
            {
                ret = new CCSequence();
                tmpZone = new CCZone(ret);
            }

            base.copyWithZone(tmpZone);

            CCFiniteTimeAction param1 = m_pActions[0].copy() as CCFiniteTimeAction;
            CCFiniteTimeAction param2 = m_pActions[1].copy() as CCFiniteTimeAction;

            if (param1 == null || param2 == null)
            {
                return null;
            }

            ret.initOneTwo(param1, param2);

            return ret;
        }
Ejemplo n.º 4
0
        public override void onEnter()
        {
            base.onEnter();

            m_pInScene.Scale  = 0.001f;
            m_pOutScene.Scale = 1.0f;

            m_pInScene.AnchorPoint  = new CCPoint(0.5f, 0.5f);
            m_pOutScene.AnchorPoint = new CCPoint(0.5f, 0.5f);

            CCActionInterval rotozoom = (CCActionInterval)(CCSequence.actions
                                                           (
                                                               CCSpawn.actions
                                                               (
                                                                   CCScaleBy.actionWithDuration(m_fDuration / 2, 0.001f),
                                                                   CCRotateBy.actionWithDuration(m_fDuration / 2, 360 * 2)
                                                               ),
                                                               CCDelayTime.actionWithDuration(m_fDuration / 2)
                                                           ));

            m_pOutScene.RunAction(rotozoom);
            m_pInScene.RunAction
            (
                CCSequence.actions
                (
                    rotozoom.Reverse(),
                    CCCallFunc.actionWithTarget(this, (base.finish))
                )
            );
        }
Ejemplo n.º 5
0
        public LabelAtlasColorTest()
        {
            CCLabelAtlas label1 = CCLabelAtlas.labelWithString("123 Test", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' ');

            addChild(label1, 0, (int)TagSprite.kTagSprite1);
            label1.position = new CCPoint(10, 100);
            label1.Opacity  = 200;

            CCLabelAtlas label2 = CCLabelAtlas.labelWithString("0123456789", "fonts/tuffy_bold_italic-charmap.png", 48, 64, ' ');

            addChild(label2, 0, (int)TagSprite.kTagSprite2);
            label2.position = new CCPoint(10, 200);
            //label2.setColor( ccRED );
            label2.Color = ccRED;

            CCActionInterval fade = CCFadeOut.actionWithDuration(1.0f);
            //CCActionInterval fade_in = fade.reverse();
            CCActionInterval   fade_in = null;
            CCFiniteTimeAction seq     = CCSequence.actions(fade, fade_in, null);
            CCAction           repeat  = CCRepeatForever.actionWithAction((CCActionInterval)seq);

            label2.runAction(repeat);

            m_time = 0;

            //schedule( schedule_selector(LabelAtlasColorTest.step) ); //:@selector(step:)];
        }
Ejemplo n.º 6
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone     tmpZone = zone;
            CCSequence ret     = null;

            if (tmpZone != null && tmpZone.m_pCopyObject != null)
            {
                ret = tmpZone.m_pCopyObject as CCSequence;
                if (ret == null)
                {
                    return(null);
                }
            }
            else
            {
                ret     = new CCSequence();
                tmpZone = new CCZone(ret);
            }

            base.copyWithZone(tmpZone);

            CCFiniteTimeAction param1 = m_pActions[0].copy() as CCFiniteTimeAction;
            CCFiniteTimeAction param2 = m_pActions[1].copy() as CCFiniteTimeAction;

            if (param1 == null || param2 == null)
            {
                return(null);
            }

            ret.initOneTwo(param1, param2);

            return(ret);
        }
Ejemplo n.º 7
0
        // CCLayer
        public override void onEnter()
        {
            base.onEnter();

            m_nCharLimit = 12;

            m_pTextFieldAction = CCRepeatForever.actionWithAction(
                (CCActionInterval)CCSequence.actions(
                    CCFadeOut.actionWithDuration(0.25f),
                    CCFadeIn.actionWithDuration(0.25f)));
            //m_pTextFieldAction->retain();
            m_bAction = false;

            // add CCTextFieldTTF
            CCSize s = CCDirector.sharedDirector().getWinSize();

            m_pTextField = CCTextFieldTTF.textFieldWithPlaceHolder("<click here for input>",
                                                                   TextInputTestScene.FONT_NAME, TextInputTestScene.FONT_SIZE);
            addChild(m_pTextField);

            //m_pTextField.setDelegate(this);


            //#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
            //    // on android, CCTextFieldTTF cannot auto adjust its position when soft-keyboard pop up
            //    // so we had to set a higher position
            //    m_pTextField->setPosition(new CCPoint(s.width / 2, s.height/2 + 50));
            //#else
            //    m_pTextField->setPosition(ccp(s.width / 2, s.height / 2));
            //#endif

            m_pTrackNode = m_pTextField;
        }
Ejemplo n.º 8
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize s = CCDirector.sharedDirector().getWinSize();

            m_pInScene.scale        = 0.5f;
            m_pInScene.position     = new CCPoint(s.width, 0);
            m_pInScene.anchorPoint  = new CCPoint(0.5f, 0.5f);
            m_pOutScene.anchorPoint = new CCPoint(0.5f, 0.5f);

            CCActionInterval jump     = CCJumpBy.actionWithDuration(m_fDuration / 4, new CCPoint(-s.width, 0), s.width / 4, 2);
            CCActionInterval scaleIn  = CCScaleTo.actionWithDuration(m_fDuration / 4, 1.0f);
            CCActionInterval scaleOut = CCScaleTo.actionWithDuration(m_fDuration / 4, 0.5f);

            CCActionInterval jumpZoomOut = (CCActionInterval)(CCSequence.actions(scaleOut, jump));
            CCActionInterval jumpZoomIn  = (CCActionInterval)(CCSequence.actions(jump, scaleIn));

            CCActionInterval delay = CCDelayTime.actionWithDuration(m_fDuration / 2);

            m_pOutScene.runAction(jumpZoomOut);
            m_pInScene.runAction
            (
                CCSequence.actions
                (
                    delay,
                    jumpZoomIn,
                    CCCallFunc.actionWithTarget(this, base.finish)
                )
            );
        }
Ejemplo n.º 9
0
        public override void onEnter()
        {
            float single;
            float single1;
            float single2;
            float single3;

            base.onEnter();
            this.m_pInScene.visible = false;
            if (this.m_eOrientation != tOrientation.kOrientationRightOver)
            {
                single  = -90f;
                single1 = 90f;
                single2 = -90f;
                single3 = 0f;
            }
            else
            {
                single  = 90f;
                single1 = 270f;
                single2 = 90f;
                single3 = 0f;
            }
            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { CCDelayTime.actionWithDuration(this.m_fDuration / 2f), CCShow.action(), CCOrbitCamera.actionWithDuration(this.m_fDuration / 2f, 1f, 0f, single1, single, 0f, 0f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            CCActionInterval     cCActionInterval        = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray);

            CCFiniteTimeAction[] cCFiniteTimeActionArray1 = new CCFiniteTimeAction[] { CCOrbitCamera.actionWithDuration(this.m_fDuration / 2f, 1f, 0f, single3, single2, 0f, 0f), CCHide.action(), CCDelayTime.actionWithDuration(this.m_fDuration / 2f) };
            CCActionInterval     cCActionInterval1        = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray1);

            this.m_pInScene.runAction(cCActionInterval);
            this.m_pOutScene.runAction(cCActionInterval1);
        }
Ejemplo n.º 10
0
        public bool initOneTwo(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
        {
            Debug.Assert(action1 != null);
            Debug.Assert(action2 != null);

            bool bRet = false;

            float d1 = action1.duration;
            float d2 = action2.duration;

            if (base.initWithDuration(Math.Max(d1, d2)))
            {
                m_pOne = action1;
                m_pTwo = action2;

                if (d1 > d2)
                {
                    m_pTwo = CCSequence.actionOneTwo(action2, CCDelayTime.actionWithDuration(d1 - d2));
                }
                else if (d1 < d2)
                {
                    m_pOne = CCSequence.actionOneTwo(action1, CCDelayTime.actionWithDuration(d2 - d1));
                }

                bRet = true;
            }

            return(bRet);
        }
Ejemplo n.º 11
0
        public static CCSequence actionOneTwo(CCFiniteTimeAction actionOne, CCFiniteTimeAction actionTwo)
        {
            CCSequence sequence = new CCSequence();

            sequence.initOneTwo(actionOne, actionTwo);

            return(sequence);
        }
Ejemplo n.º 12
0
        protected CCSequence(CCSequence sequence)
            : base(sequence)
        {
            var param1 = sequence.m_pActions[0].Copy() as CCFiniteTimeAction;
            var param2 = sequence.m_pActions[1].Copy() as CCFiniteTimeAction;

            InitOneTwo(param1, param2);
        }
Ejemplo n.º 13
0
        public Atlas4()
        {
            m_time = 0;

            // Upper Label
            CCLabelBMFont label = CCLabelBMFont.labelWithString("Bitmap Font Atlas", "fonts/bitmapFontTest.fnt");

            addChild(label);

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

            label.position    = new CCPoint(s.width / 2, s.height / 2);
            label.anchorPoint = new CCPoint(0.5f, 0.5f);


            CCSprite BChar = (CCSprite)label.getChildByTag(1);
            CCSprite FChar = (CCSprite)label.getChildByTag(7);
            CCSprite AChar = (CCSprite)label.getChildByTag(12);


            CCActionInterval rotate    = CCRotateBy.actionWithDuration(2, 360);
            CCAction         rot_4ever = CCRepeatForever.actionWithAction(rotate);

            CCActionInterval scale = CCScaleBy.actionWithDuration(2, 1.5f);
            //CCActionInterval scale_back = scale.reverse();
            CCActionInterval   scale_back  = null;
            CCFiniteTimeAction scale_seq   = CCSequence.actions(scale, scale_back, null);
            CCAction           scale_4ever = CCRepeatForever.actionWithAction((CCActionInterval)scale_seq);

            CCActionInterval jump       = CCJumpBy.actionWithDuration(0.5f, new CCPoint(), 60, 1);
            CCAction         jump_4ever = CCRepeatForever.actionWithAction(jump);

            CCActionInterval   fade_out   = CCFadeOut.actionWithDuration(1);
            CCActionInterval   fade_in    = CCFadeIn.actionWithDuration(1);
            CCFiniteTimeAction seq        = CCSequence.actions(fade_out, fade_in, null);
            CCAction           fade_4ever = CCRepeatForever.actionWithAction((CCActionInterval)seq);

            BChar.runAction(rot_4ever);
            BChar.runAction(scale_4ever);
            FChar.runAction(jump_4ever);
            AChar.runAction(fade_4ever);


            // Bottom Label
            CCLabelBMFont label2 = CCLabelBMFont.labelWithString("00.0", "fonts/bitmapFontTest.fnt");

            addChild(label2, 0, (int)TagSprite.kTagBitmapAtlas2);
            label2.position = new CCPoint(s.width / 2.0f, 80);

            CCSprite lastChar = (CCSprite)label2.getChildByTag(3);

            lastChar.runAction((CCAction)(rot_4ever.copy()));

            //schedule( schedule_selector(Atlas4::step), 0.1f);
            base.schedule(step, 0.1f);
        }
Ejemplo n.º 14
0
        public override void onEnter()
        {
            base.onEnter();
            this.initScenes();
            CCActionInterval cCActionInterval = this.action();
            CCScene          mPInScene        = this.m_pInScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { this.easeActionWithAction(cCActionInterval), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            mPInScene.runAction(CCSequence.actions(cCFiniteTimeActionArray));
        }
Ejemplo n.º 15
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize           winSize          = CCDirector.sharedDirector().getWinSize();
            int              num              = (int)(12f * (winSize.width / winSize.height));
            CCActionInterval cCActionInterval = this.actionWithSize(new ccGridSize(num, 12));
            CCScene          mPOutScene       = this.m_pOutScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { this.easeActionWithAction(cCActionInterval), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)), CCStopGrid.action() };
            mPOutScene.runAction(CCSequence.actions(cCFiniteTimeActionArray));
        }
Ejemplo n.º 16
0
        public static CCSequence FromActions(params CCFiniteTimeAction[] actions)
        {
            CCFiniteTimeAction prev = actions[0];

            for (int i = 1; i < actions.Length; i++)
            {
                prev = new CCSequence (prev, actions[i]);
            }

            return (CCSequence) prev;
        }
Ejemplo n.º 17
0
        public override void onEnter()
        {
            base.onEnter();
            this.m_pInScene.visible = false;
            CCActionInterval cCActionInterval = this.action();

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { cCActionInterval, CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.hideOutShowIn)), cCActionInterval.reverse() };
            CCActionInterval     cCActionInterval1       = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray);

            CCFiniteTimeAction[] cCFiniteTimeActionArray1 = new CCFiniteTimeAction[] { this.easeActionWithAction(cCActionInterval1), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)), CCStopGrid.action() };
            base.runAction(CCSequence.actions(cCFiniteTimeActionArray1));
        }
Ejemplo n.º 18
0
        public override void onEnter()
        {
            base.onEnter();
            CCLayerColor cCLayerColor = CCLayerColor.layerWithColor(this.m_tColor);

            this.m_pInScene.visible = false;
            this.addChild(cCLayerColor, 2, 2147483647);
            CCNode childByTag = base.getChildByTag(2147483647);

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { CCFadeIn.actionWithDuration(this.m_fDuration / 2f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.hideOutShowIn)), CCFadeOut.actionWithDuration(this.m_fDuration / 2f), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            childByTag.runAction((CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray));
        }
Ejemplo n.º 19
0
        public override void onEnter()
        {
            base.onEnter();

            CCActionInterval inA, outA;

            m_pInScene.Visible = false;

            float inDeltaZ, inAngleZ;
            float outDeltaZ, outAngleZ;

            if (m_eOrientation == tOrientation.kOrientationUpOver)
            {
                inDeltaZ  = 90;
                inAngleZ  = 270;
                outDeltaZ = 90;
                outAngleZ = 0;
            }
            else
            {
                inDeltaZ  = -90;
                inAngleZ  = 90;
                outDeltaZ = -90;
                outAngleZ = 0;
            }

            inA = (CCActionInterval)CCSequence.actions
                  (
                CCDelayTime.actionWithDuration(m_fDuration / 2),
                CCSpawn.actions
                (
                    new CCOrbitCamera(m_fDuration / 2, 1, 0, inAngleZ, inDeltaZ, 90, 0),
                    CCScaleTo.actionWithDuration(m_fDuration / 2, 1),
                    CCShow.action()
                ),
                CCCallFunc.actionWithTarget(this, base.finish)
                  );

            outA = (CCActionInterval)CCSequence.actions
                   (
                CCSpawn.actions
                (
                    new CCOrbitCamera(m_fDuration / 2, 1, 0, outAngleZ, outDeltaZ, 90, 0),
                    CCScaleTo.actionWithDuration(m_fDuration / 2, 0.5f)
                ),
                CCHide.action(),
                CCDelayTime.actionWithDuration(m_fDuration / 2)
                   );

            m_pInScene.Scale = 0.5f;
            m_pInScene.RunAction(inA);
            m_pOutScene.RunAction(outA);
        }
Ejemplo n.º 20
0
        public override void onEnter()
        {
            base.onEnter();
            // create a transparent color layer
            // in which we are going to add our rendertextures
            CCSize size = CCDirector.sharedDirector().getWinSize();

            // create the second render texture for outScene
            CCRenderTexture outTexture = CCRenderTexture.renderTextureWithWidthAndHeight((int)size.width, (int)size.height);

            if (outTexture == null)
            {
                return;
            }

            outTexture.Sprite.anchorPoint = new CCPoint(0.5f, 0.5f);
            outTexture.position           = new CCPoint(size.width / 2, size.height / 2);
            outTexture.anchorPoint        = new CCPoint(0.5f, 0.5f);

            // render outScene to its texturebuffer
            outTexture.clear(0, 0, 0, 1);
            outTexture.begin();
            m_pOutScene.visit();
            outTexture.end();

            //	Since we've passed the outScene to the texture we don't need it.
            this.hideOutShowIn();

            //	We need the texture in RenderTexture.
            CCProgressTimer outNode = CCProgressTimer.progressWithTexture(outTexture.Sprite.Texture);

            // but it's flipped upside down so we flip the sprite
            //outNode.Sprite.->setFlipY(true);
            //	Return the radial type that we want to use
            outNode.Type        = radialType();
            outNode.Percentage  = 100.0f;
            outNode.position    = new CCPoint(size.width / 2, size.height / 2);
            outNode.anchorPoint = new CCPoint(0.5f, 0.5f);

            // create the blend action
            CCAction layerAction = CCSequence.actions
                                   (
                CCProgressFromTo.actionWithDuration(m_fDuration, 100.0f, 0.0f),
                CCCallFunc.actionWithTarget(this, base.finish)
                                   );

            // run the blend action
            outNode.runAction(layerAction);

            // add the layer (which contains our two rendertextures) to the scene
            this.addChild(outNode, 2, kSceneRadial);
        }
Ejemplo n.º 21
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize             winSize            = CCDirector.sharedDirector().getWinSize();
            int                num                = (int)(12f * (winSize.width / winSize.height));
            int                num1               = 12;
            CCTurnOffTiles     cCTurnOffTile      = CCTurnOffTiles.actionWithSize(new ccGridSize(num, num1), this.m_fDuration);
            CCFiniteTimeAction cCFiniteTimeAction = this.easeActionWithAction(cCTurnOffTile);
            CCScene            mPOutScene         = this.m_pOutScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { cCFiniteTimeAction, CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)), CCStopGrid.action() };
            mPOutScene.runAction(CCSequence.actions(cCFiniteTimeActionArray));
        }
Ejemplo n.º 22
0
        public static CCFiniteTimeAction actionsWithArray(CCFiniteTimeAction[] actions)
        {
            CCFiniteTimeAction cCFiniteTimeAction = actions[0];

            for (int i = 1; i < (int)actions.Length; i++)
            {
                if (actions[i] != null)
                {
                    cCFiniteTimeAction = CCSequence.actionOneTwo(cCFiniteTimeAction, actions[i]);
                }
            }
            return(cCFiniteTimeAction);
        }
Ejemplo n.º 23
0
        public virtual bool onTextFieldInsertText(CCTextFieldTTF pSender, string text, int nLen)
        {
            // if insert enter, treat as default to detach with ime
            if ("\n" == text)
            {
                return(false);
            }

            // if the textfield's char count more than m_nCharLimit, doesn't insert text anymore.
            if (pSender.CharCount >= m_nCharLimit)
            {
                return(true);
            }

            // create a insert text sprite and do some action
            CCLabelTTF label = CCLabelTTF.labelWithString(text, TextInputTestScene.FONT_NAME, TextInputTestScene.FONT_SIZE);

            this.addChild(label);
            ccColor3B color = new ccColor3B {
                r = 226, g = 121, b = 7
            };

            label.Color = color;

            // move the sprite from top to position
            CCPoint endPos = pSender.position;

            if (pSender.CharCount > 0)
            {
                endPos.x += pSender.contentSize.width / 2;
            }
            CCSize  inputTextSize = label.contentSize;
            CCPoint beginPos      = new CCPoint(endPos.x, CCDirector.sharedDirector().getWinSize().height - inputTextSize.height * 2);

            float duration = 0.5f;

            label.position = beginPos;
            label.scale    = 8;

            CCAction seq = CCSequence.actions(
                CCSpawn.actions(
                    CCMoveTo.actionWithDuration(duration, endPos),
                    CCScaleTo.actionWithDuration(duration, 1),
                    CCFadeOut.actionWithDuration(duration)),
                CCCallFuncN.actionWithTarget(this, callbackRemoveNodeWhenDidAction));

            label.runAction(seq);
            return(false);
        }
Ejemplo n.º 24
0
        public override void onEnter()
        {
            base.onEnter();
            this.initScenes();

            CCActionInterval a = this.action();

            m_pInScene.RunAction
            (
                CCSequence.actions
                (
                    this.easeActionWithAction(a),
                    CCCallFunc.actionWithTarget(this, base.finish)
                )
            );
        }
Ejemplo n.º 25
0
        public override void onEnter()
        {
            base.onEnter();
            this.m_pInScene.scale        = 0.001f;
            this.m_pOutScene.scale       = 1f;
            this.m_pInScene.anchorPoint  = new CCPoint(0.6666667f, 0.5f);
            this.m_pOutScene.anchorPoint = new CCPoint(0.333333343f, 0.5f);
            CCActionInterval cCActionInterval  = CCScaleTo.actionWithDuration(this.m_fDuration, 0.01f);
            CCActionInterval cCActionInterval1 = CCScaleTo.actionWithDuration(this.m_fDuration, 1f);

            this.m_pInScene.runAction(this.easeActionWithAction(cCActionInterval1));
            CCScene mPOutScene = this.m_pOutScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { this.easeActionWithAction(cCActionInterval), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            mPOutScene.runAction(CCSequence.actions(cCFiniteTimeActionArray));
        }
Ejemplo n.º 26
0
        public override void onEnter()
        {
            base.onEnter();
            m_pInScene.Visible = false;

            CCActionInterval split = action();
            CCActionInterval seq   = (CCActionInterval)CCSequence.actions
                                     (
                split,
                CCCallFunc.actionWithTarget(this, (base.hideOutShowIn)),
                split.Reverse()
                                     );

            this.RunAction(CCSequence.actions(
                               easeActionWithAction(seq),
                               CCCallFunc.actionWithTarget(this, base.finish),
                               CCStopGrid.action()));
        }
Ejemplo n.º 27
0
        public override void onEnter()
        {
            base.onEnter();
            this.initScenes();

            CCActionInterval incAction  = this.action();
            CCActionInterval outcAction = this.action();

            CCActionInterval inAction  = easeActionWithAction(incAction);
            CCActionInterval outAction = (CCActionInterval)CCSequence.actions
                                         (
                easeActionWithAction(outcAction),
                CCCallFunc.actionWithTarget(this, (base.finish))
                                         );

            m_pInScene.RunAction(inAction);
            m_pOutScene.RunAction(outAction);
        }
Ejemplo n.º 28
0
        public override void onEnter()
        {
            base.onEnter();
            this.m_pInScene.scale        = 0.001f;
            this.m_pOutScene.scale       = 1f;
            this.m_pInScene.anchorPoint  = new CCPoint(0.5f, 0.5f);
            this.m_pOutScene.anchorPoint = new CCPoint(0.5f, 0.5f);
            CCFiniteTimeAction[] cCFiniteTimeActionArray  = new CCFiniteTimeAction[2];
            CCFiniteTimeAction[] cCFiniteTimeActionArray1 = new CCFiniteTimeAction[] { CCScaleBy.actionWithDuration(this.m_fDuration / 2f, 0.001f), CCRotateBy.actionWithDuration(this.m_fDuration / 2f, 720f) };
            cCFiniteTimeActionArray[0] = CCSpawn.actions(cCFiniteTimeActionArray1);
            cCFiniteTimeActionArray[1] = CCDelayTime.actionWithDuration(this.m_fDuration / 2f);
            CCActionInterval cCActionInterval = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray);

            this.m_pOutScene.runAction(cCActionInterval);
            CCScene mPInScene = this.m_pInScene;

            CCFiniteTimeAction[] cCFiniteTimeActionArray2 = new CCFiniteTimeAction[] { cCActionInterval.reverse(), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            mPInScene.runAction(CCSequence.actions(cCFiniteTimeActionArray2));
        }
Ejemplo n.º 29
0
        public override void onEnter()
        {
            base.onEnter();
            ccColor4B       _ccColor4B = new ccColor4B(0, 0, 0, 0);
            CCSize          winSize    = CCDirector.sharedDirector().getWinSize();
            CCLayer         cCLayer    = new CCLayer();
            CCRenderTexture cCPoint    = CCRenderTexture.renderTextureWithWidthAndHeight((int)winSize.width, (int)winSize.height);

            if (cCPoint == null)
            {
                return;
            }
            cCPoint.Sprite.anchorPoint = new CCPoint(0.5f, 0.5f);
            cCPoint.position           = new CCPoint(winSize.width / 2f, winSize.height / 2f);
            cCPoint.anchorPoint        = new CCPoint(0.5f, 0.5f);
            cCPoint.begin();
            this.m_pInScene.visit();
            cCPoint.end();
            CCRenderTexture cCRenderTexture = CCRenderTexture.renderTextureWithWidthAndHeight((int)winSize.width, (int)winSize.height);

            cCRenderTexture.Sprite.anchorPoint = new CCPoint(0.5f, 0.5f);
            cCRenderTexture.position           = new CCPoint(winSize.width / 2f, winSize.height / 2f);
            cCRenderTexture.anchorPoint        = new CCPoint(0.5f, 0.5f);
            cCRenderTexture.begin();
            this.m_pOutScene.visit();
            cCRenderTexture.end();
            ccBlendFunc _ccBlendFunc  = new ccBlendFunc(1, 1);
            ccBlendFunc _ccBlendFunc1 = new ccBlendFunc(770, 771);

            cCPoint.Sprite.BlendFunc         = _ccBlendFunc;
            cCRenderTexture.Sprite.BlendFunc = _ccBlendFunc1;
            cCLayer.addChild(cCPoint);
            cCLayer.addChild(cCRenderTexture);
            cCPoint.Sprite.Opacity         = 255;
            cCRenderTexture.Sprite.Opacity = 255;
            CCFiniteTimeAction[] cCFiniteTimeActionArray = new CCFiniteTimeAction[] { CCFadeTo.actionWithDuration(this.m_fDuration, 0), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.hideOutShowIn)), CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish)) };
            CCAction             cCAction = CCSequence.actions(cCFiniteTimeActionArray);

            cCRenderTexture.Sprite.runAction(cCAction);
            this.addChild(cCLayer, 2, 2147483647);
        }
Ejemplo n.º 30
0
        public override void onEnter()
        {
            base.onEnter();
            CCSize s      = Director.SharedDirector.DesignSize;
            float  aspect = s.Width / s.Height;
            int    x      = (int)(12 * aspect);
            int    y      = 12;

            CCTurnOffTiles     toff   = CCTurnOffTiles.actionWithSize(new ccGridSize(x, y), m_fDuration);
            CCFiniteTimeAction action = easeActionWithAction(toff);

            m_pOutScene.RunAction
            (
                CCSequence.actions
                (
                    action,
                    CCCallFunc.actionWithTarget(this, (base.finish)),
                    CCStopGrid.action()
                )
            );
        }
Ejemplo n.º 31
0
        public override void onEnter()
        {
            base.onEnter();

            CCSize s      = Director.SharedDirector.DesignSize;
            float  aspect = s.Width / s.Height;
            int    x      = (int)(12 * aspect);
            int    y      = 12;

            CCActionInterval action = actionWithSize(new ccGridSize(x, y));

            m_pOutScene.RunAction
            (
                CCSequence.actions
                (
                    easeActionWithAction(action),
                    CCCallFunc.actionWithTarget(this, base.finish),
                    CCStopGrid.action()
                )
            );
        }
Ejemplo n.º 32
0
        public override void onEnter()
        {
            base.onEnter();

            CCLayerColor l = CCLayerColor.layerWithColor(m_tColor);

            m_pInScene.visible = false;

            addChild(l, 2, kSceneFade);
            CCNode f = getChildByTag(kSceneFade);

            CCActionInterval a = (CCActionInterval)CCSequence.actions
                                 (
                CCFadeIn.actionWithDuration(m_fDuration / 2),
                CCCallFunc.actionWithTarget(this, (base.hideOutShowIn)),
                CCFadeOut.actionWithDuration(m_fDuration / 2),
                CCCallFunc.actionWithTarget(this, (base.finish))
                                 );

            f.runAction(a);
        }
Ejemplo n.º 33
0
        public override void onEnter()
        {
            float single;
            float single1;
            float single2;
            float single3;

            base.onEnter();
            this.m_pInScene.visible = false;
            if (this.m_eOrientation != tOrientation.kOrientationLeftOver)
            {
                single  = -90f;
                single1 = 90f;
                single2 = -90f;
                single3 = 0f;
            }
            else
            {
                single  = 90f;
                single1 = 270f;
                single2 = 90f;
                single3 = 0f;
            }
            CCFiniteTimeAction[] cCFiniteTimeActionArray  = new CCFiniteTimeAction[] { CCDelayTime.actionWithDuration(this.m_fDuration / 2f), null, null };
            CCFiniteTimeAction[] cCFiniteTimeActionArray1 = new CCFiniteTimeAction[] { CCOrbitCamera.actionWithDuration(this.m_fDuration / 2f, 1f, 0f, single1, single, 90f, 0f), CCScaleTo.actionWithDuration(this.m_fDuration / 2f, 1f), CCShow.action() };
            cCFiniteTimeActionArray[1] = CCSpawn.actions(cCFiniteTimeActionArray1);
            cCFiniteTimeActionArray[2] = CCCallFunc.actionWithTarget(this, new SEL_CallFunc(this.finish));
            CCActionInterval cCActionInterval = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray);

            CCFiniteTimeAction[] cCFiniteTimeActionArray2 = new CCFiniteTimeAction[3];
            CCFiniteTimeAction[] cCFiniteTimeActionArray3 = new CCFiniteTimeAction[] { CCOrbitCamera.actionWithDuration(this.m_fDuration / 2f, 1f, 0f, single3, single2, 90f, 0f), CCScaleTo.actionWithDuration(this.m_fDuration / 2f, 0.5f) };
            cCFiniteTimeActionArray2[0] = CCSpawn.actions(cCFiniteTimeActionArray3);
            cCFiniteTimeActionArray2[1] = CCHide.action();
            cCFiniteTimeActionArray2[2] = CCDelayTime.actionWithDuration(this.m_fDuration / 2f);
            CCActionInterval cCActionInterval1 = (CCActionInterval)CCSequence.actions(cCFiniteTimeActionArray2);

            this.m_pInScene.scale = 0.5f;
            this.m_pInScene.runAction(cCActionInterval);
            this.m_pOutScene.runAction(cCActionInterval1);
        }
Ejemplo n.º 34
0
        public override void onEnter()
        {
            base.onEnter();

            CCSize s = Director.SharedDirector.DesignSize;
            int    x, y;

            if (s.Width > s.Height)
            {
                x = 16;
                y = 12;
            }
            else
            {
                x = 12;
                y = 16;
            }

            CCActionInterval action = this.actionWithSize(ccTypes.ccg(x, y));

            if (!m_bBack)
            {
                m_pOutScene.RunAction(CCSequence.actions
                                      (
                                          action,
                                          CCCallFunc.actionWithTarget(this, base.finish),
                                          CCStopGrid.action()));
            }
            else
            {
                // to prevent initial flicker
                m_pInScene.Visible = false;
                m_pInScene.RunAction(CCSequence.actions
                                     (
                                         CCShow.action(),
                                         action,
                                         CCCallFunc.actionWithTarget(this, base.finish),
                                         CCStopGrid.action()));
            }
        }
Ejemplo n.º 35
0
        public override void OnEnter()
        {
            base.OnEnter();
            CCSize size = CCDirector.SharedDirector.WinSize;

            // The .png image MUST be power of 2 in order to create a continue effect.
            // eg: 32x64, 512x128, 256x1024, 64x64, etc..
            var sprite = new CCSprite("Images/pattern1.png", new CCRect(0, 0, 512, 256));
            AddChild(sprite, -1, (int)enumTag.kTagSprite1);
            sprite.Position = new CCPoint(size.Width/2,size.Height/2);

            #if OPENGL
            sprite.Texture.TexParameters = new CCTexParams() {  MagFilter = (uint)All.Linear,
                MinFilter = (uint)All.Linear,
                WrapS = (uint)All.ClampToEdge,
                WrapT = (uint)All.ClampToEdge
            };
            #else
            sprite.Texture.SamplerState = SamplerState.LinearClamp;
            #endif
            var rotate = new CCRotateBy(4, 360);
            sprite.RunAction(rotate);
            var scale = new CCScaleBy(2, 0.04f);
            var scaleBack = (CCScaleBy)scale.Reverse();
            var seq = new CCSequence(scale, scaleBack);
            sprite.RunAction(seq);
        }
Ejemplo n.º 36
0
        public void RunAnimations(int nSeqId, float fTweenDuration)
        {
            Debug.Assert(nSeqId != -1, "Sequence id couldn't be found");

            mRootNode.StopAllActions();

            foreach (var pElement in mNodeSequences)
            {
                CCNode node = pElement.Key;
                node.StopAllActions();

                // Refer to CCBReader::readKeyframe() for the real type of value
                Dictionary<int, Dictionary<string, CCBSequenceProperty>> seqs = pElement.Value;

                var seqNodePropNames = new List<string>();

                Dictionary<string, CCBSequenceProperty> seqNodeProps;
                if (seqs.TryGetValue(nSeqId, out seqNodeProps))
                {
                    // Reset nodes that have sequence node properties, and run actions on them
                    foreach (var pElement1 in seqNodeProps)
                    {
                        string propName = pElement1.Key;
                        CCBSequenceProperty seqProp = pElement1.Value;
                        seqNodePropNames.Add(propName);

                        SetFirstFrame(node, seqProp, fTweenDuration);
                        RunAction(node, seqProp, fTweenDuration);
                    }
                }

                // Reset the nodes that may have been changed by other timelines
                Dictionary<string, object> nodeBaseValues;
                if (mBaseValues.TryGetValue(node, out nodeBaseValues))
                {
                    foreach (var pElement2 in nodeBaseValues)
                    {
                        if (!seqNodePropNames.Contains(pElement2.Key))
                        {
                            object value = pElement2.Value;

                            if (value != null)
                            {
                                SetAnimatedProperty(pElement2.Key, node, value, fTweenDuration);
                            }
                        }
                    }
                }
            }

            // Make callback at end of sequence
            CCBSequence seq = GetSequence(nSeqId);
            CCAction completeAction = new CCSequence (
                new CCDelayTime (seq.Duration + fTweenDuration),
                new CCCallFunc(SequenceCompleted)
                );

            mRootNode.RunAction(completeAction);

            // Set the running scene
            mRunningSequence = GetSequence(nSeqId);
        }