public void MouseMove(MouseMoveEventArgs mouseMoveEventArgs)
        {
            // Update which control is considered hovered.
            var newHovered = MouseGetControl(mouseMoveEventArgs.Position);

            if (newHovered != CurrentlyHovered)
            {
                CurrentlyHovered?.MouseExited();
                CurrentlyHovered = newHovered;
                CurrentlyHovered?.MouseEntered();
            }

            var target = _controlFocused ?? newHovered;

            if (target != null)
            {
                var guiArgs = new GUIMouseMoveEventArgs(mouseMoveEventArgs.Relative / UIScale,
                                                        target,
                                                        mouseMoveEventArgs.Position / UIScale, mouseMoveEventArgs.Position,
                                                        mouseMoveEventArgs.Position / UIScale - target.GlobalPosition,
                                                        mouseMoveEventArgs.Position - target.GlobalPixelPosition.ToVector2());

                _doMouseGuiInput(target, guiArgs, (c, ev) => c.MouseMove(ev));
            }
        }
Beispiel #2
0
 protected internal virtual void MouseMove(GUIMouseMoveEventArgs args)
 {
 }