コード例 #1
0
ファイル: Effect2.cs プロジェクト: HarkDev/cocos2d-xna
        public override void OnEnter()
        {
            base.OnEnter();

            CCNode target = GetChildByTag(EffectAdvanceScene.kTagBackground);

            // To reuse a grid the grid size and the grid type must be the same.
            // in this case:
            //     ShakyTiles is TiledGrid3D and it's size is (15,10)
            //     Shuffletiles is TiledGrid3D and it's size is (15,10)
            //	   TurnOfftiles is TiledGrid3D and it's size is (15,10)
            CCActionInterval shaky = new CCShakyTiles3D(4, false, new CCGridSize(15, 10), 5);
            CCActionInterval shuffle = new CCShuffleTiles(0, new CCGridSize(15, 10), 3);
            CCActionInterval turnoff = new CCTurnOffTiles(0, new CCGridSize(15, 10), 3);
            CCFiniteTimeAction turnon = turnoff.Reverse();

            // reuse 2 times:
            //   1 for shuffle
            //   2 for turn off
            //   turnon tiles will use a new grid
            CCFiniteTimeAction reuse = new CCReuseGrid(2);

            CCActionInterval delay = new CCDelayTime (1);

            //	id orbit = [OrbitCamera::actionWithDuration:5 radius:1 deltaRadius:2 angleZ:0 deltaAngleZ:180 angleX:0 deltaAngleX:-90];
            //	id orbit_back = [orbit reverse];
            //
            //	[target runAction: [RepeatForever::actionWithAction: [Sequence actions: orbit, orbit_back, nil]]];
            target.RunAction((CCSequence.FromActions(shaky, delay, reuse, shuffle, (CCFiniteTimeAction) delay.Copy(), turnoff, turnon)));
        }
コード例 #2
0
ファイル: CCReuseGrid.cs プロジェクト: chengcong/cocos2d-xna
        public static CCReuseGrid actionWithTimes(int times)
        {
            CCReuseGrid cCReuseGrid = new CCReuseGrid();

            if (cCReuseGrid != null)
            {
                cCReuseGrid.initWithTimes(times);
            }
            return(cCReuseGrid);
        }
コード例 #3
0
ファイル: CCReuseGrid.cs プロジェクト: liwq-net/liwq718
        /// <summary>
        /// creates an action with the number of times that the current grid will be reused
        /// </summary>
        /// <param name="times"></param>
        /// <returns></returns>
        public static CCReuseGrid actionWithTimes(int times)
        {
            CCReuseGrid pAction = new CCReuseGrid();
            if (pAction != null)
            {
                if (pAction.initWithTimes(times))
                {
                    //pAction->autorelease();
                }
                else
                {
                    //CC_SAFE_DELETE(pAction);
                }
            }

            return pAction;
        }
コード例 #4
0
        /// <summary>
        /// creates an action with the number of times that the current grid will be reused
        /// </summary>
        /// <param name="times"></param>
        /// <returns></returns>
        public static CCReuseGrid actionWithTimes(int times)
        {
            CCReuseGrid pAction = new CCReuseGrid();

            if (pAction != null)
            {
                if (pAction.initWithTimes(times))
                {
                    //pAction->autorelease();
                }
                else
                {
                    //CC_SAFE_DELETE(pAction);
                }
            }

            return(pAction);
        }
コード例 #5
0
ファイル: Effect1.cs プロジェクト: KogleDK/cocos2d-xna-1
        public override void OnEnter()
        {
            base.OnEnter();

            CCNode target = GetChildByTag(EffectAdvanceScene.kTagBackground);

            // To reuse a grid the grid size and the grid type must be the same.
            // in this case:
            //     Lens3D is Grid3D and it's size is (15,10)
            //     Waves3D is Grid3D and it's size is (15,10)

            CCSize size = CCDirector.SharedDirector.WinSize;
            CCActionInterval lens = new CCLens3D(new CCPoint(size.Width / 2, size.Height / 2), 240, new CCGridSize(15, 10), 0.0f);
            CCActionInterval waves = new CCWaves3D(18, 15, new CCGridSize(15, 10), 10);

            CCFiniteTimeAction reuse = new CCReuseGrid(1);
            CCActionInterval delay = new CCDelayTime (8);

            CCActionInterval orbit = new CCOrbitCamera(5, 1, 2, 0, 180, 0, -90);
            CCFiniteTimeAction orbit_back = orbit.Reverse();

            target.RunAction(new CCRepeatForever ((CCSequence.FromActions(orbit, orbit_back))));
            target.RunAction(CCSequence.FromActions(lens, delay, reuse, waves));
        }