예제 #1
0
 public void StartDrag(DraggableItem item, int amount)
 {
     CurrentItem       = item;
     CurrentDragAmount = amount;
     CurrentItem.Item.CurrentAmount -= amount;
     OnDragStarted.Invoke(CurrentItem, CurrentDragAmount);
 }
예제 #2
0
 private void Ellipse_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         OnDragStarted?.Invoke();
     }
 }
예제 #3
0
 private void DraggableItem_OnPressed()
 {
     if (!IsDragging)
     {
         IsDragging = true;
         OnDragStarted.Invoke();
     }
 }
예제 #4
0
 /// <summary>
 /// Starts card drag.
 /// </summary>
 public void OnPointerDown(PointerEventData eventData)
 {
     if (_isPlayed == true)
     {
         // Card was already played
         return;
     }
     _isDragged  = true;
     _dragOffset = transform.position - Input.mousePosition;
     OnDragStarted?.Invoke(this);
 }
 private void OnItemDrag(object sender, MouseEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         if (SongList.SelectedItem != null)
         {
             OnDragStarted?.Invoke((SongList.SelectedItem as Song).ID, CurrentPlaylist.ID);
             DragDrop.DoDragDrop(SongList, (SongList.SelectedItem), DragDropEffects.Copy);
         }
     }
 }
예제 #6
0
 private void Grid_MouseMove(object sender, MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         DataObject dataObject = new DataObject();
         dataObject.SetData("Face", Face);
         DragDrop.DoDragDrop(this, dataObject, DragDropEffects.Move);
         OnDragStarted?.Invoke(this);
         OnDragStarted = null;
     }
 }
        private void DragAreaTracker_MouseDown(object sender, MouseButtonEventArgs e)
        {
            mouse_down_point     = e.GetPosition(canvas);
            button_left_pressed  = e.LeftButton == MouseButtonState.Pressed;
            button_right_pressed = e.RightButton == MouseButtonState.Pressed;

            if (null == current_annotation)
            {
                canvas.CaptureMouse();

                current_annotation = new DragAreaControl(visible);

                Canvas.SetLeft(current_annotation, mouse_down_point.X);
                Canvas.SetTop(current_annotation, mouse_down_point.Y);
                current_annotation.Width  = 0;
                current_annotation.Height = 0;

                canvas.Children.Add(current_annotation);

                OnDragStarted?.Invoke(button_left_pressed, button_right_pressed, mouse_down_point);

                OnDragInProgress?.Invoke(button_left_pressed, button_right_pressed, mouse_down_point, mouse_down_point);
            }
        }
 private void HandleDragStarted()
 {
     IsDragged = true;
     OnDragStarted?.Invoke(this);
 }
예제 #9
0
 protected override void OnThumbDragStarted(DragStartedEventArgs e)
 {
     base.OnThumbDragStarted(e);
     OnDragStarted?.Invoke(this, e);
 }
예제 #10
0
 private void ThumbOnDragStarted(object sender, DragStartedEventArgs e)
 {
     OnDragStarted?.Invoke(this, e);
 }
예제 #11
0
        public void StartDragging()
        {
            IsDragging = true;

            OnDragStarted?.Invoke();
        }
예제 #12
0
 public void OnPointerDown(PointerEventData eventData)
 {
     dragOffset = eventData.position - new Vector2(Screen.width / 2f, Screen.height / 2f) - (Vector2)transform.localPosition;
     isDragging = true;
     OnDragStarted?.Invoke(startPointIndex, evenlySpacedPoints.Count);
 }