protected virtual void Mouse_Move(object sender, OpenTK.Input.MouseMoveEventArgs e) { Drag(e.X, e.Y); InputReceiverVisual irv = null; Component cmp = (Component)GameObj.Camera.PickRendererAt(e.X, e.Y); if (cmp != null) { irv = cmp.GameObj.GetComponent <InputReceiverVisual>(); } if (HoveredElement != irv) { if (HoveredElement != null) { HoveredElement.MouseLeave(); } if (irv != null) { irv.MouseEnter(); } } HoveredElement = irv; }
protected virtual void Mouse_ButtonUp(object sender, OpenTK.Input.MouseButtonEventArgs e) { _draggedElement = null; if (FocusedElement != null && FocusedElement.ReceiveMouseClicks) { FocusedElement.MouseUp(e); } if (Receiver != null && ShouldNotifyReceiver()) { Receiver.MouseUp(e); } Mouse_Move(sender, new OpenTK.Input.MouseMoveEventArgs(e.X, e.Y, 0, 0)); }
protected virtual void Mouse_ButtonDown(object sender, OpenTK.Input.MouseButtonEventArgs e) { FocusedElement = HoveredElement; if (FocusedElement != null && FocusedElement.Draggable) { _lastMousePosition.X = e.X; _lastMousePosition.Y = e.Y; _draggedElement = FocusedElement; } else if (FocusedElement != null && FocusedElement.ReceiveMouseClicks) { FocusedElement.MouseDown(e); } if (Receiver != null && ShouldNotifyReceiver()) { Receiver.MouseDown(e); } Mouse_Move(sender, new OpenTK.Input.MouseMoveEventArgs(e.X, e.Y, 0, 0)); }