| Modifier and Type | Field and Description |
|---|---|
| private Texture | backingStore
A reference to the backing store that was created (lazily) by the backing store manager. |
| private int | |
| private List | levels
Manages a list of Levels; this is the core data structure contained within the RectanglePacker and encompasses the storage algorithm for the contained Rects. |
| private static final int | |
| private int | |
| private static final int | |
| private int | |
| private int | |
| private boolean | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | RectanglePacker(Texture
The backing store texture, must not be null backingStore, int The width of the backing store, must be > 0 (typically > 512) width, int The height of the backing store, must be > 0 (typically > 512) height)Creates a new RectanglePacker. |
| Modifier and Type | Method and Description |
|---|---|
| public final boolean | |
| private static int | binarySearch(List<Level> levels, int k)
Using binary search to find the last index of best fit level for k, where k is a rounded-up value. |
| public void | |
| public void | |
| public final Texture | Returns: A reference to the backing store.Gets a reference to the backing store, creating it lazily if necessary. |
| backingStore | back to summary |
|---|---|
| private Texture backingStore A reference to the backing store that was created (lazily) by the backing store manager. | |
| length | back to summary |
|---|---|
| private int length | |
| levels | back to summary |
|---|---|
| private List<Level> levels Manages a list of Levels; this is the core data structure contained within the RectanglePacker and encompasses the storage algorithm for the contained Rects. | |
| MIN_SIZE | back to summary |
|---|---|
| private static final int MIN_SIZE | |
| recentUsedLevelIndex | back to summary |
|---|---|
| private int recentUsedLevelIndex | |
| ROUND_UP | back to summary |
|---|---|
| private static final int ROUND_UP | |
| size | back to summary |
|---|---|
| private int size | |
| sizeOffset | back to summary |
|---|---|
| private int sizeOffset | |
| vertical | back to summary |
|---|---|
| private boolean vertical | |
| x | back to summary |
|---|---|
| private int x | |
| y | back to summary |
|---|---|
| private int y | |
| RectanglePacker | back to summary |
|---|---|
| public RectanglePacker(Texture backingStore, int x, int y, int width, int height, boolean vertical) | |
| RectanglePacker | back to summary |
|---|---|
| public RectanglePacker(Texture backingStore, int width, int height) Creates a new RectanglePacker. You must specify the texture used as the backing store, and the width and height of the space within which rectangles are to be packed.
| |
| add | back to summary |
|---|---|
| public final boolean add(Rectangle rect) Decides upon an (x, y) position for the given rectangle (leaving its width and height unchanged) and places it on the backing store. | |
| binarySearch | back to summary |
|---|---|
| private static int binarySearch(List<Level> levels, int k) Using binary search to find the last index of best fit level for k, where k is a rounded-up value. | |
| clear | back to summary |
|---|---|
| public void clear() Clears all Rectangles contained in this RectanglePacker. | |
| dispose | back to summary |
|---|---|
| public void dispose() Disposes the backing store allocated by the BackingStoreManager. This RectanglePacker may no longer be used after calling this method. | |
| getBackingStore | back to summary |
|---|---|
| public final Texture getBackingStore() Gets a reference to the backing store, creating it lazily if necessary.
| |