public class RectanglePacker extends Object
Constructor and Description |
---|
RectanglePacker(Texture backingStore,
int width,
int height)
Creates a new RectanglePacker.
|
RectanglePacker(Texture backingStore,
int x,
int y,
int width,
int height,
boolean vertical) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
clear()
Clears all Rectangles contained in this RectanglePacker.
|
void |
dispose()
Disposes the backing store allocated by the
BackingStoreManager.
|
Texture |
getBackingStore()
Gets a reference to the backing store, creating it lazily if necessary.
|
public RectanglePacker(Texture backingStore, int x, int y, int width, int height, boolean vertical)
public RectanglePacker(Texture backingStore, int width, int height)
backingStore
- The backing store texture, must not be nullwidth
- The width of the backing store, must be > 0 (typically > 512)height
- The height of the backing store, must be > 0 (typically > 512)public final Texture getBackingStore()
public final boolean add(Rectangle rect)
public void clear()
public void dispose()
Copyright © 2020. All rights reserved.