public static void MouseLeftPress(Btn[] buttons, MouseState mouse) { foreach (Btn btn in buttons) { if (btn.Collides(mouse.X, mouse.Y)) { if (mouse.LeftButton == ButtonState.Pressed) btn.State = BtnState.Active; else btn.State = BtnState.Over; } else btn.State = BtnState.Normal; } }
public static void MouseOver(Btn[] buttons, MouseState mouse) { foreach (Btn btn in buttons) { if (btn.Collides(mouse.X, mouse.Y)) btn.setOver(); else btn.setNormal(); } }