public bool CheckMousePress(Button button)
 {
     if (CurrentMouseState.LeftButton == ButtonState.Pressed)
     {
         if (CurrentMouseState.X <= button.Position.X + button.Width &&
             CurrentMouseState.X >= button.Position.X &&
             CurrentMouseState.Y <= button.Position.Y + button.Height &&
             CurrentMouseState.Y >= button.Position.Y)
         {
             return true;
         }
     }
     return false;
 }
Example #2
0
 protected override void LoadScreenContent(ContentManager content)
 {
     titleText = content.Load<Texture2D>("Images/TitleText");
     gameButton = new Button(content, "Game", new Vector2(ScreenWidth / 2 - 100, 400), Color.Blue, Color.White);
 }