CCT.NUI.Samples.ImageManipulation.InteractiveImage.Translate C# (CSharp) Method

Translate() public method

public Translate ( float dx, float dy ) : void
dx float
dy float
return void
        public void Translate(float dx, float dy)
        {
            if (dx > 200 || dy > 200)
            {
                return;
            }
            this.position.X += dx;
            this.position.Y += dy;
        }

Usage Example

Esempio n. 1
0
        public void HandleTranslation(InteractiveImage image, float zoomFactory)
        {
            this.hoveredImage = image;
            hoveredImage.Hovered = true;
            
            pts_gathered++;

            if (isResizing)
            {
                return;
            }
            var handClosed = handData.FingerCount <= 1;
            if (isDragging)
            {
                hoveredImage.Translate((handData.PalmPoint.Value.X - startDragPoint.X) * zoomFactory, (handData.PalmPoint.Value.Y - startDragPoint.Y) * zoomFactory);
            }
            if (handClosed)
            {
                //if (pts_gathered % 2 == 0)
                    startDragPoint = new Point(handData.PalmPoint.Value.X, handData.PalmPoint.Value.Y, 0);
                /*else
                {
                    startDragPoint.X += handData.PalmPoint.Value.X;
                    startDragPoint.Y += handData.PalmPoint.Value.Y;

                    startDragPoint.X = startDragPoint.X / pts_gathered % 2;
                    startDragPoint.Y = startDragPoint.Y / pts_gathered % 2;
                }*/
            }
            isDragging = handClosed;
        }
All Usage Examples Of CCT.NUI.Samples.ImageManipulation.InteractiveImage::Translate