/// <summary> /// See if the mouse clicks a button /// </summary> /// <param name="rect">GuiButton to click</param> /// <returns>true if clicked | false if not</returns> private static bool IntersectsWith(GuiButton rect) { Point pw = Mouse.GetPosition(rect.getBoundingBox().getTexture()); Point ps = win.PointToScreen(pw); double x = ps.X; double y = ps.Y; return((rect.posX < x) && (x < (rect.posX + rect.getBoundingBox().getTexture().Width)) && (rect.posY < y) && (y < rect.posY + rect.getBoundingBox().getTexture().Height)); }