Пример #1
0
 /// <summary>
 /// Handles the mouse move event to check if the mouse is over a control
 /// </summary>
 /// <param name="e"></param>
 public void MouseMove(MouseEventArgs e)
 {
     _currentHoverControl = null;
     //finds the last item in the list (in case of stacking ui controls) where the mouse is within the
     foreach (GUIBaseControl control in _controls)
     {
         if (control.PositionX < e.X && (control.PositionX + control.Width) > e.X &&
             control.PositionY < e.Y && (control.PositionY + control.Height) > e.Y)
         {
             _currentHoverControl = control;
         }
     }
 }