RectangleGrid
Represents a rectangular grid structure composed of lists of Rectangle instances.
This class provides a convenient abstraction for working with 2D grids, where each cell is represented by a Rectangle. The class delegates to the underlying grid structure, which is implemented as a list of lists, allowing it to be used interchangeably with other list-based data structures.
Properties
Functions
Aligns a list of rectangles horizontally relative to a specified rectangle.
Aligns the rectangles in the list vertically to a reference rectangle. The vertical position of each rectangle is determined based on the reference rectangle and the specified vertical anchor point.
Create an alpha shape from list of Vector2
Extracts a sub-block from a 2D list of rectangles based on the specified coordinates and dimensions.
Distributes the rectangles in the list horizontally within a specified bounding rectangle.
Distributes the rectangles in the list vertically within the given bounding rectangle. The rectangles are spaced evenly, ensuring an equal distance between them, while maintaining their original height and width.
Drops the first n columns from a 2D list of Rectangles.
Removes the last n
columns from each row (inner list) within a two-dimensional list.
Distributes a list of rectangles horizontally within a given container rectangle, maintaining their relative width proportions and adding an optional gutter between them.
Fits a list of rectangles within a given vertical rectangular area. Each rectangle's height is adjusted proportionally based on its original height relative to the total height of all rectangles in the list. The rectangles are then distributed vertically, with an optional gutter spacing between them.
Retrieves a Rectangle from a two-dimensional list of Rectangles based on the specified x and y indices.
Retrieves a list of rectangles at a specific x-coordinate for a range of y-coordinates from a 2D list of rectangles.
Retrieves a sublist of Rectangle objects from a two-dimensional List given a range of indices for rows and a specific column index.
Retrieves a subgrid from a 2D list of Rectangles based on the specified ranges.
Selects specific columns from a two-dimensional list of rectangles. The method slices each inner list based on the provided column indices.
Slices the specified range of columns from each row of a two-dimensional list.
Subtracts a given Box from each Box in the list and returns a list of the resulting Boxes.
Subtracts a rectangle from a list of rectangles, removing overlapping areas and returning the non-overlapping parts of the original rectangles.
Selects the first n
columns from each row in a 2D list of Rectangle
objects.
Returns a new list where each sub-list contains only the last n
elements of the original sub-list.
Transposes a 2D list of rectangles, switching rows and columns.
Extracts a uniform random sub-block of rectangles from a 2D list within the specified constraints.