Godot Version
4.4.1
Question
I am looking for built-in methods to handle this otherwise i need to write everything from scratch. Assume a grid, and bunch of points such as ((1,2), (2,0), (6,4),(5,5)). I want to create biggest possible rectangle by looking max,min of x and y of every point.
So possible biggest rectangle of these 4 points is 36 cells.
I tried Rect2i.expand()
but rect2i calculates every area from 0.0, i can not give starting point such as (1,0) here.
Tried array.min()
and array.max()
but it returns (6,4) not (5,5), so i am missing an extra column(6 cells).
-----------------------------------------------------------------------------------------
Another example
Biggest rectangle area of above points should be 15 cells.
--------------------------------------------------------------------------------------
If points are in straight line such as array of points of (1,2),(1,3),(1,4)
then it should return 3
With what methods should i achieve what i want? I have Array[Vector2i]