Ejemplo n.º 1
0
        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(0.0f, new CCGridSize(15, 10), new CCPoint(size.Width / 2, size.Height / 2), 240);
            CCActionInterval waves = new CCWaves3D(10, new CCGridSize(15, 10), 18, 15);


            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 ((new CCSequence(orbit, orbit_back))));
            target.RunAction(new CCSequence(lens, delay, reuse, waves));
        }
Ejemplo n.º 2
0
        public override void OnEnter()
        {
            base.OnEnter();

            CCLens3D lens = new CCLens3D(10, new CCGridSize(32, 24), new CCPoint(100, 180), 150);
            CCJumpBy move = new CCJumpBy (5, new CCPoint(380, 0), 100, 4);
            var move_back = (CCActionInterval) move.Reverse();
            CCSequence seq = new CCSequence(move, move_back);

            /* In cocos2d-iphone, the type of action's target is 'id', so it supports using the instance of 'CCLens3D' as its target.
                While in cocos2d-x, the target of action only supports CCNode or its subclass,
                so we make an encapsulation for CCLens3D to achieve that.
            */

            CCDirector director = CCDirector.SharedDirector;
            CCNode target = Lens3DTarget.Create(lens);
            // Please make sure the target been added to its parent.
            AddChild(target);

            director.ActionManager.AddAction(seq, target, false);
            RunAction(lens);
        }
Ejemplo n.º 3
0
 public static Lens3DTarget Create(CCLens3D pAction)
 {
     var pRet = new Lens3DTarget();
     pRet.m_pLens3D = pAction;
     return pRet;
 }
Ejemplo n.º 4
0
 public CCLens3D (CCLens3D lens3D)
 {
     InitWithPosition(lens3D.m_position, lens3D.m_fRadius, lens3D.m_sGridSize, lens3D.m_fDuration);
 }
Ejemplo n.º 5
0
 public CCLens3D(CCLens3D lens3D)
 {
     InitWithDuration(lens3D.m_fDuration, lens3D.m_sGridSize, lens3D.m_position, lens3D.m_fRadius);
 }