Inheritance: IManipulationUpdatedEventArgs
Example #1
0
 private void OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e)
 {
     if (Math.Abs(e.Delta.Translation.X) > Math.Abs(e.Delta.Translation.Y))
     {
         if (e.Delta.Translation.X > 0)
             RadialPanel.Angle -= e.Delta.Translation.X / ROTATION_RATE;
         else
             RadialPanel.Angle += (e.Delta.Translation.X * -1) / ROTATION_RATE;
     }
     else
     {
         if (e.Delta.Translation.Y > 0)
             RadialPanel.Angle += e.Delta.Translation.Y / ROTATION_RATE;
         else
             RadialPanel.Angle -= (e.Delta.Translation.Y * -1) / ROTATION_RATE;
     }
 }
Example #2
0
 public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     player.OnManipulationUpdated(sender, args);
     // Update camera position for all game objects
     foreach (var obj in gameObjects)
     {
         if (obj.basicEffect != null) { obj.basicEffect.View = player.View; }
         obj.OnManipulationUpdated(sender, args);
     }
 }
 public void OnManipulateUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     float scale = args.Cumulative.Scale;
     if (scale > 1)
     {
         zoom = zoom_init - Constants.cameraZoomSpeedTouch * (1 - 1 / scale);
     }
     else
     {
         zoom = zoom_init + Constants.cameraZoomSpeedTouch * (1 - scale);
     }
 }
 public override void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     // pos.X += (float)args.Delta.Translation.X / 100;
 }
        void gr_ManipulationUpdated(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.ManipulationUpdatedEventArgs args)
        {
#if (DEBUG)
            System.Diagnostics.Debug.WriteLine("gr_ManipulationUpdated");
#endif
        }
        // Process the change resulting from a manipulation
        void OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e)
        {
            previousTransform.Matrix = cumulativeTransform.Value;

            // Get the center point of the manipulation for rotation
            Point center = new Point(e.Position.X, e.Position.Y);
            deltaTransform.CenterX = center.X;
            deltaTransform.CenterY = center.Y;

            // Look at the Delta property of the ManipulationDeltaRoutedEventArgs to retrieve
            // the rotation, X, and Y changes
            deltaTransform.Rotation = e.Delta.Rotation;
            deltaTransform.TranslateX = e.Delta.Translation.X;
            deltaTransform.TranslateY = e.Delta.Translation.Y;
        }
 public void OnManipulateUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     float scale = args.Cumulative.Scale;
     if (scale > 1)
     {
         ZoomIn(zoomSpeed * touchZoomSpeedFactor * (1 - 1 / scale));
     }
     else
     {
         ZoomOut(zoomSpeed * touchZoomSpeedFactor * (1 - scale));
     }
 }
Example #8
0
 public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     if (main.focussld == false)
     {
         scaleFactor /= (float)args.Delta.Scale;
         AngleH += (float)args.Delta.Translation.X / 500;
         AngleV += (float)args.Delta.Translation.Y / 500;
     }
 }
Example #9
0
        void OnManipulationUpdated(object sender, ManipulationUpdatedEventArgs e)
        {
            this.previousTransform.Matrix = this.cumulativeTransform.Value;

            Point center = new Point(e.Position.X, e.Position.Y);

            this.deltaTransform.CenterX = center.X;
            this.deltaTransform.CenterY = center.Y;

            this.deltaTransform.Rotation = e.Delta.Rotation;
            this.deltaTransform.ScaleX = deltaTransform.ScaleY = e.Delta.Scale;
            this.deltaTransform.TranslateX = e.Delta.Translation.X;
            this.deltaTransform.TranslateY = e.Delta.Translation.Y;
        }
        private void ManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
        {
            //if (_selectedIndicator == null)
            //    return;

            //PointerPoint currentPoint = e.GetCurrentPoint(this);

            //if (_selectedIndicator == Indicator1)
            //    Quality1 = Quality1 + currentPoint.Properties.MouseWheelDelta / 10;
            //else if (_selectedIndicator == Indicator2)
            //    Quality2 = Quality2 + currentPoint.Properties.MouseWheelDelta / 10;
            //else if (_selectedIndicator == Indicator3)
            //    Quality3 = Quality3 + currentPoint.Properties.MouseWheelDelta / 10;
            //else if (_selectedIndicator == Indicator4)
            //    Quality4 = Quality4 + currentPoint.Properties.MouseWheelDelta / 10;
        }
Example #11
0
 public override void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     float deltaX = -(float)args.Delta.Translation.X * scaleDown;
     Yaw = (float)(Math.PI * 2 * deltaX);
     Pitch += (float)args.Delta.Translation.Y / 500;
     float distance = (float)Math.Sqrt(Math.Pow(currentTarget.X, 2) + Math.Pow(currentTarget.Z, 2));
     if (Pitch > Math.PI / 4) Pitch = (float)Math.PI / 4;
     if (Pitch < -Math.PI / 4) Pitch = -(float)Math.PI / 4;
     yTarget = (float)(distance * Math.Tan(Pitch));
 }
        /// <summary>
        /// Handle touch/mouse manipulation updated
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
        {

            hitDistance += 0.01f;

            Vector2 location = new Vector2((float)args.Position.X, (float)args.Position.Y);

            if (grabBody != null)
            { //if we already have a grabbody....
                HandleMoveGrabBody(location);
            }
            else
            {//...or if we pick one up on our swiping journey
                HandleGrabBody(location);
            }
        }
        private void GrOnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
        {
            var x = args.Cumulative.Translation.X;
            double delta;
            TranslateTransform transform;

            if (x > 0)
            {
                if (this.RightPane.IsAvailable && this.IsRightPaneOpen) // close right pane
                {
                    delta = x <= this.RightSlidingWidth
                        ? x - this.RightSlidingWidth
                        : 0;
                    transform = new TranslateTransform() { X = delta };
                }
                else if (this.LeftPane.IsAvailable && !this.IsLeftPaneOpen) // open left pane
                {
                    delta = x <= this.LeftSlidingWidth
                        ? x
                        : this.LeftSlidingWidth;
                    transform = new TranslateTransform { X = delta };
                }
                else
                {
                    return;
                }
            }
            else
            {
                if (this.LeftPane.IsAvailable && this.IsLeftPaneOpen) // close left pane
                {
                    delta = x >= -this.LeftSlidingWidth
                        ? -x
                        : this.LeftSlidingWidth;
                    transform = new TranslateTransform { X = this.LeftSlidingWidth - delta };
                }
                else if (this.RightPane.IsAvailable && !this.IsRightPaneOpen) // open right pane
                {
                    delta = x >= -this.RightSlidingWidth
                        ? x
                        : -this.RightSlidingWidth;
                    transform = new TranslateTransform { X = delta };
                }
                else
                {
                    return;
                }
            }

            this.Container.RenderTransform = transform;
        }
Example #14
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     camera.pos.Z = camera.pos.Z * args.Delta.Scale; //Only the camera responds to pinch/stretch
 }
Example #15
0
 public virtual void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
 }
Example #16
0
        public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
        {
            //TASK 3: Update camera position when scaling occurs

             /*   camera.pos.Z = camera.pos.Z * args.Delta.Scale;

            // Update camera position for all game objects

            foreach (var obj in gameObjects)
            {

                if (obj.basicEffect != null) { obj.basicEffect.View = camera.View; }

                // TASK 4: Respond to OnManipulationUpdated events for linear motion

                obj.OnManipulationUpdated(sender, args);

            }*/
        }
Example #17
0
 public void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     camera.OnManipulationUpdated(sender, args);
 }
Example #18
0
 // Simulates a key press when a horizontal drag occurs
 public override void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     if (game.gameState == GameController.GameState.Started)
     {
         updateTargetPosition((float)args.Position.X, (float)args.Position.Y);
     }
 }
Example #19
0
 void gestureRecognizer_ManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     offset = offset - (float)args.Delta.Translation.Y;
     targetVelocity = -Math.Sign(args.Velocities.Linear.Y) * targetSpeed;
 }
Example #20
0
 // Initiate event upon recieving a swipe input
 public override void OnManipulationUpdated(GestureRecognizer sender, ManipulationUpdatedEventArgs args)
 {
     //Do nothing
 }