private bool buttonClicked(MenuButton b, MouseState ms) { Rectangle buttonArea = new Rectangle(b.x, b.y, b.width, b.height); return(buttonArea.Contains(ms.X, ms.Y)); }
public void addButton(String text, Color color, Color clickedColor, int x, int y, int width, int height, ButtonDelegate onClick) { MenuButton b = new MenuButton(text, color, clickedColor, x, y, width, height, onClick); buttons.Add(b); }