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 / 4, size.Height / 4), 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)); }
public override void OnEnter() { // todo : CCOrbitCamera hasn't been implement base.OnEnter(); centerSprites(3); var orbit1 = new CCOrbitCamera(2, 1, 0, 0, 180, 0, 0); var action1 = CCSequence.FromActions(orbit1, orbit1.Reverse()); var orbit2 = new CCOrbitCamera(2, 1, 0, 0, 180, -45, 0); var action2 = CCSequence.FromActions(orbit2, orbit2.Reverse()); var orbit3 = new CCOrbitCamera(2, 1, 0, 0, 180, 90, 0); var action3 = CCSequence.FromActions(orbit3, orbit3.Reverse()); m_kathia.RunAction(new CCRepeatForever(action1)); m_tamara.RunAction(new CCRepeatForever(action2)); m_grossini.RunAction(new CCRepeatForever(action3)); var move = new CCMoveBy(3, new CCPoint(100, -100)); var move_back = move.Reverse(); var seq = CCSequence.FromActions(move, move_back); var rfe = new CCRepeatForever(seq); m_kathia.RunAction(rfe); m_tamara.RunAction((CCAction)(rfe.Copy())); m_grossini.RunAction((CCAction)(rfe.Copy())); }
public override void OnEnter() { base.OnEnter(); GameView.DepthTesting = true; CCRect visibleBounds = VisibleBoundsWorldspace; // 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) var lens = new CCLens3D(0.0f, new CCGridSize(15, 10), visibleBounds.Center, 200); var waves = new CCWaves3D(10, new CCGridSize(15, 10), 18, 30); var reuse = new CCReuseGrid(1); var delay = new CCDelayTime(8); //bgNode.AnchorPoint = CCPoint.AnchorMiddle; var orbit = new CCOrbitCamera(5, 1.0f, 2, 0, 180, 0, -90); var orbit_back = orbit.Reverse(); //bgNode.RepeatForever(orbit, orbit_back); bgNode.RunActions(lens, delay, reuse, waves); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; // 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) CCCamera contentCamera = contentLayer.Camera; contentCamera.Projection = CCCameraProjection.Projection3D; contentCamera.PerspectiveAspectRatio = 1.0f; CCPoint3 cameraCenter = contentCamera.CenterInWorldspace; CCPoint3 cameraTarget = contentCamera.TargetInWorldspace; float targeCenterLength = (cameraTarget - cameraCenter).Length; contentCamera.NearAndFarPerspectiveClipping = new CCPoint(0.1f, 100.0f); contentCamera.PerspectiveFieldOfView = (float)Math.PI / 3.0f; //(float)Math.Atan(visibleBounds.Size.Height / (2.0f * targeCenterLength)); var lens = new CCLens3D(0.0f, new CCGridSize(15, 10), bgNode.ContentSize.Center, 90); var waves = new CCWaves3D(10, new CCGridSize(15, 10), 18, 15); var reuse = new CCReuseGrid(1); var delay = new CCDelayTime(8); bgNode.AnchorPoint = CCPoint.AnchorMiddle; var orbit = new CCOrbitCamera(5, 30.0f, 2, 20, 180, 0, -90); var orbit_back = orbit.Reverse(); bgNode.RepeatForever(orbit, orbit_back); bgNode.RunActions(lens, delay, reuse, waves); }