public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; 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.15f, 100.0f); contentCamera.PerspectiveFieldOfView = (float)Math.Atan(visibleBounds.Size.Height / (2.0f * targeCenterLength)); var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, 180), 80); var move = new CCJumpBy(5, new CCPoint(600, 0), 100, 5); var move_back = move.Reverse(); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, move, move_back); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; 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.15f, 100.0f); contentCamera.PerspectiveFieldOfView = (float)Math.Atan(visibleBounds.Size.Height / (2.0f * targeCenterLength)); var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, 180), 80); var move = new CCJumpBy (5, new CCPoint(600, 0), 100, 5); var move_back = move.Reverse(); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, move, move_back); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; var radius = 150; var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, visibleBounds.Center.Y - radius / 2), radius); var jumpBy = new CCJumpBy (5, new CCPoint(600, 0), 100, 5); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, jumpBy, jumpBy.Reverse()); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, 180), 80); var move = new CCJumpBy(5, new CCPoint(600, 0), 100, 5); var move_back = move.Reverse(); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, move, move_back); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, 180), 80); var move = new CCJumpBy (5, new CCPoint(600, 0), 100, 5); var move_back = move.Reverse(); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, move, move_back); }
public override void OnEnter() { base.OnEnter(); CCRect visibleBounds = VisibleBoundsWorldspace; var radius = 150; var lens = new CCLens3D(10, new CCGridSize(64, 48), new CCPoint(100, visibleBounds.Center.Y - radius / 2), radius); var jumpBy = new CCJumpBy(5, new CCPoint(600, 0), 100, 5); CCLens3DState lensState = bgNode.RunAction(lens) as CCLens3DState; var target = new Lens3DTarget(lensState); // Please make sure the target has been added to its parent. AddChild(target); target.AddActions(false, jumpBy, jumpBy.Reverse()); }