Ejemplo n.º 1
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;
        }
        public static CCReverseTime actionWithAction(CCFiniteTimeAction action)
        {
            CCReverseTime ret = new CCReverseTime();
            ret.initWithAction(action);

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

            return sequence;
        }
Ejemplo n.º 4
0
        /** creates the Spawn action */
        public static CCSpawn actionOneTwo(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
        {
            CCSpawn spawn = new CCSpawn();
            spawn.initOneTwo(action1, action2);

            return spawn;
        }
Ejemplo n.º 5
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.º 6
0
        public static CCFiniteTimeAction actionsWithArray(CCFiniteTimeAction[] actions)
        {
            CCFiniteTimeAction cCFiniteTimeAction = actions[0];

            for (int i = 1; i < (int)actions.Length; i++)
            {
                cCFiniteTimeAction = CCSpawn.actionOneTwo(cCFiniteTimeAction, actions[i]);
            }
            return(cCFiniteTimeAction);
        }
Ejemplo n.º 7
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.º 8
0
 public bool initWithAction(CCFiniteTimeAction action, uint times)
 {
     if (!base.initWithDuration(action.duration * (float)((float)times)))
     {
         return(false);
     }
     this.m_uTimes       = times;
     this.m_pInnerAction = action;
     this.m_uTotal       = 0;
     return(true);
 }
Ejemplo n.º 9
0
        /** helper contructor to create an array of spawned actions given an array */
        public static CCFiniteTimeAction actionsWithArray(CCFiniteTimeAction[] actions)
        {
            CCFiniteTimeAction prev = actions[0];

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

            return(prev);
        }
Ejemplo n.º 10
0
        /** helper contructor to create an array of spawned actions given an array */
        public static CCFiniteTimeAction actionsWithArray(CCFiniteTimeAction[] actions)
        {
            CCFiniteTimeAction prev = actions[0];

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

            return prev;
        }
Ejemplo n.º 11
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.º 12
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.º 13
0
        /// <summary>
        /// initializes the action
        /// </summary>
        public bool initOneTwo(CCFiniteTimeAction actionOne, CCFiniteTimeAction aciontTwo)
        {
            Debug.Assert(actionOne != null);
            Debug.Assert(aciontTwo != null);

            float d = actionOne.duration + aciontTwo.duration;
            base.initWithDuration(d);

            m_pActions[0] = actionOne;
            m_pActions[1] = aciontTwo;

            return true;
        }
Ejemplo n.º 14
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.º 15
0
        public bool initWithAction(CCFiniteTimeAction action)
        {
            Debug.Assert(action != null);
            Debug.Assert(action != m_pOther);

            if (base.initWithDuration(action.duration))
            {
                m_pOther = action;

                return(true);
            }

            return(false);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// initializes the action
        /// </summary>
        public bool initOneTwo(CCFiniteTimeAction actionOne, CCFiniteTimeAction aciontTwo)
        {
            Debug.Assert(actionOne != null);
            Debug.Assert(aciontTwo != null);

            float d = actionOne.Duration + aciontTwo.Duration;

            base.initWithDuration(d);

            m_pActions[0] = actionOne;
            m_pActions[1] = aciontTwo;

            return(true);
        }
Ejemplo n.º 17
0
 public override object Copy(ICopyable zone)
 {
     if (zone != null)
     {
         var ret = zone as CCReverseTime;
         base.Copy(zone);
         m_pOther = (CCFiniteTimeAction)ret.m_pOther; // .Copy() was in here before
         return ret;
     }
     else
     {
         return new CCReverseTime(this);
     }
 }
Ejemplo n.º 18
0
        public bool initWithAction(CCFiniteTimeAction action)
        {
            Debug.Assert(action != null);
            Debug.Assert(action != m_pOther);

            if (base.initWithDuration(action.duration))
            {
                m_pOther = action;

                return true;
            }

            return false;
        }
Ejemplo n.º 19
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.º 20
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.º 21
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), null, null, null };
            CCFiniteTimeAction[] cCFiniteTimeActionArray1 = new CCFiniteTimeAction[] { CCOrbitCamera.actionWithDuration(this.m_fDuration / 2f, 1f, 0f, single1, single, -45f, 0f), CCScaleTo.actionWithDuration(this.m_fDuration / 2f, 1f), CCShow.action() };
            cCFiniteTimeActionArray[1] = CCSpawn.actions(cCFiniteTimeActionArray1);
            cCFiniteTimeActionArray[2] = CCShow.action();
            cCFiniteTimeActionArray[3] = 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, 45f, 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.º 22
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.º 23
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.º 24
0
        public bool initOneTwo(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
        {
            bool  flag    = false;
            float single  = action1.duration;
            float single1 = action2.duration;

            if (base.initWithDuration(Math.Max(single, single1)))
            {
                this.m_pOne = action1;
                this.m_pTwo = action2;
                if (single > single1)
                {
                    this.m_pTwo = CCSequence.actionOneTwo(action2, CCDelayTime.actionWithDuration(single - single1));
                }
                else if (single < single1)
                {
                    this.m_pOne = CCSequence.actionOneTwo(action1, CCDelayTime.actionWithDuration(single1 - single));
                }
                flag = true;
            }
            return(flag);
        }
Ejemplo n.º 25
0
 protected CCSpawn(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
 {
     InitOneTwo(action1, action2);
 }
Ejemplo n.º 26
0
        protected 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 = new CCSequence (action2, new CCDelayTime (d1 - d2));
                }
                else if (d1 < d2)
                {
                    m_pOne = new CCSequence (action1, new CCDelayTime (d2 - d1));
                }

                bRet = true;
            }

            return bRet;
        }
Ejemplo n.º 27
0
 public CCSequence(CCFiniteTimeAction action1, CCFiniteTimeAction action2)
 {
     InitOneTwo(action1, action2);
 }
Ejemplo n.º 28
0
 protected CCReverseTime(CCReverseTime copy)
     : base(copy)
 {
     m_pOther = copy.m_pOther;
 }
Ejemplo n.º 29
0
 public CCReverseTime(CCFiniteTimeAction action)
     : base(action.Duration)
 {
     m_pOther = action;
 }
Ejemplo n.º 30
0
 public CCSequence()
 {
     m_pActions = new CCFiniteTimeAction[2];
 }
Ejemplo n.º 31
0
 public CCSequence()
 {
     m_pActions = new CCFiniteTimeAction[2];
 }