Пример #1
0
 private void CheckButtonClick(InputState input, MenuButton button)
 {
     // If we clicked the mouse
     if (input.IsNewLeftMouseClick())
     {
         // We check the mouse to see if we're in the confines of the button and the button is enabled and we can use the mouse.
         if (input.LastMouseState.X > button.RectangleCollider.Left &&
             input.LastMouseState.X < button.RectangleCollider.Right &&
             input.LastMouseState.Y < button.RectangleCollider.Bottom &&
             input.LastMouseState.Y > button.RectangleCollider.Top &&
             button.IsEnabled)
         {
             // Fire the button's selected event.
             button.OnSelectEntry(PlayerIndex.One);
         }
     }
 }