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(); 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() { 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))); }
public override void OnEnter() { base.OnEnter(); // 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) var shaky = new CCShakyTiles3D(5, new CCGridSize(15, 10), 4, false); var shuffle = new CCShuffleTiles(new CCGridSize(15, 10), 3, 0); var turnoff = new CCTurnOffTiles(3, new CCGridSize(15, 10), 0); var turnon = turnoff.Reverse(); // reuse 2 times: // 1 for shuffle // 2 for turn off // turnon tiles will use a new grid var reuse = new CCReuseGrid(2); var 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]]]; bgNode.RunActions(shaky, delay, reuse, shuffle, delay, turnoff, turnon); }
public CCReuseGridState (CCReuseGrid action, CCNodeGrid target) : base (action, target) { CCGridBase grid = target.Grid; if (grid != null && grid.Active) { grid.ReuseGrid += action.Times; } }
public CCReuseGridState(CCReuseGrid action, CCNodeGrid target) : base(action, target) { CCGridBase grid = target.Grid; if (grid != null && grid.Active) { grid.ReuseGrid += action.Times; } }
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); }
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().getWinSize(); CCActionInterval lens = CCLens3D.actionWithPosition(new CCPoint(size.width / 2, size.height / 2), 240, new ccGridSize(15, 10), 0.0f); CCActionInterval waves = CCWaves3D.actionWithWaves(18, 15, new ccGridSize(15, 10), 10); CCFiniteTimeAction reuse = CCReuseGrid.actionWithTimes(1); CCActionInterval delay = CCDelayTime.actionWithDuration(8); CCActionInterval orbit = CCOrbitCamera.actionWithDuration(5, 1, 2, 0, 180, 0, -90); CCFiniteTimeAction orbit_back = orbit.reverse(); target.runAction(CCRepeatForever.actionWithAction((CCActionInterval)(CCSequence.actions(orbit, orbit_back)))); target.runAction(CCSequence.actions(lens, delay, reuse, waves)); }
public static CCReuseGrid Create(int times) { var pAction = new CCReuseGrid(); pAction.InitWithTimes(times); return pAction; }