Public Member Functions | |
| RectPacker (Size containerSize) | |
| Creates a RectPacker object of the specified size. | |
| void | AddRect (Rectangle rect, T tag) |
| Adds a used rectangle to the RectPacker. This throws an exception if pixels in the rectangle specified are already used. | |
| bool | FindEmptySpace (Size size, out Rectangle rect) |
| Finds an empty space of the specified size. | |
| void | QueueObject (Size size, T tag) |
| Adds an object of the specified size to the queue. | |
| void | ClearQueue () |
| Clears the queue. | |
| void | AddQueue () |
| Packs all the objects in the queue to the container. Sorts them first, to optimize coverage. | |
| ICollection< T > | UnusuedQueueObjects () |
| Returns a collection of all objects in the queue which have not been added to the container rect. | |
| IEnumerator< RectHolder< T > > | GetEnumerator () |
| Enumerates through the packed rectangles. | |
Properties | |
| Size | ContainerSize [get, set] |
| Gets or sets the size of the container to fit all the rects into. | |
| double | PixelsUsedPercentage [get] |
| Returns what percentage of the container is used up. | |
| T | The type of objects which will be added to the rectangles. This is so that the RectPacker can keep track of which rectangles go with which objects. |
| AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.RectPacker | ( | Size | containerSize | ) |
Creates a RectPacker object of the specified size.
| containerSize |
| void AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.AddQueue | ( | ) |
Packs all the objects in the queue to the container. Sorts them first, to optimize coverage.
| void AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.AddRect | ( | Rectangle | rect, | |
| T | tag | |||
| ) |
Adds a used rectangle to the RectPacker. This throws an exception if pixels in the rectangle specified are already used.
| rect | ||
| tag |
| void AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.ClearQueue | ( | ) |
Clears the queue.
| bool AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.FindEmptySpace | ( | Size | size, | |
| out Rectangle | rect | |||
| ) |
Finds an empty space of the specified size.
Returns true if there was an empty space of that size available.
| size | ||
| rect |
| IEnumerator<RectHolder<T> > AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.GetEnumerator | ( | ) |
Enumerates through the packed rectangles.
| void AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.QueueObject | ( | Size | size, | |
| T | tag | |||
| ) |
Adds an object of the specified size to the queue.
| size | ||
| tag |
| ICollection<T> AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.UnusuedQueueObjects | ( | ) |
Returns a collection of all objects in the queue which have not been added to the container rect.
Size AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.ContainerSize [get, set] |
Gets or sets the size of the container to fit all the rects into.
double AgateLib.Utility.SurfacePacker.SurfacePacker.RectPacker< T >.PixelsUsedPercentage [get] |
Returns what percentage of the container is used up.
|
AgateLib Awesome Game and Tool Engine Library |
|