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);
        }
Exemple #2
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);
        }