I am wondering if there is an easier way to check if the mouse is in a rectangle. Currently I am using an if statement like so
if (mX > rectX && mX < rectX + 20 && mY > rectY && my < rectY + 10){
} // where mX is mouse X and mY is mouse Y and rectX is the rectangle x and rectY is the rectangle y and + 20 is the width and +10 is the height
This is very time consuming. I am wondering if there is a quicker way of doing this.
Thanks for your help.