positionInRect function

bool positionInRect(
  1. Vector2 position,
  2. Rect rect
)

Implementation

bool positionInRect(Vector2 position, Rect rect) {
  return position.x >= rect.left &&
      position.x <= rect.right &&
      position.y >= rect.top &&
      position.y <= rect.bottom;
}