Hello.
First of all, I am aware that there would ideally be easier ways to operate what I am trying to do, but I feel like in my precise case, they wouldn't be practical, so please bear with me.
My issue is the following:
I currently have code that creates a bunch of rectangle2D in a chessboard pattern and draws them on screen. Rectangle 2d's are handy because they have both a position value and an end value, both of which are Vector2D's.
I would like to write code that allows me to know when the mouse is clicked inside one of those rectangles, and which of these it was.
More precisely, what I have in mind is a way to tell if the value returned by get_viewport().get_mouse_position() is located "inside" the position and end values of a given rectangle. I just can't seem to wrap my head around the maths to do that. Help would be appreciated.
Thanks in advance.