Esempio n. 1
0
        private void OnPointerMoved(GuiPointerEventArgs args)
        {
            CursorPosition = args.Position.ToVector2();

            if (Screen == null)
            {
                return;
            }

            var hoveredControl = FindControlAtPoint(Screen.Controls, args.Position);

            if (_hoveredControl != hoveredControl)
            {
                _hoveredControl?.OnPointerLeave(args);
                _hoveredControl = hoveredControl;
                _hoveredControl?.OnPointerEnter(args);
            }
        }
Esempio n. 2
0
        private void OnPointerMoved(GuiPointerEventArgs args)
        {
            CursorPosition = args.Position.ToVector2();

            if (ActiveScreen == null || !ActiveScreen.IsVisible)
            {
                return;
            }

            var hoveredControl = FindControlAtPoint(args.Position);

            if (_hoveredControl != hoveredControl)
            {
                _hoveredControl?.OnPointerLeave(this, args);
                _hoveredControl = hoveredControl;
                _hoveredControl?.OnPointerEnter(this, args);
            }
        }