public class LibgdxTextureAtlasWrapper
extends java.lang.Object
implements com.badlogic.gdx.utils.Disposable
Modifier and Type | Class and Description |
---|---|
static class |
LibgdxTextureAtlasWrapper.AtlasRegion
Describes the region of a packed image and provides information about the original image before it was packed.
|
static class |
LibgdxTextureAtlasWrapper.AtlasSprite
A sprite that, if whitespace was stripped from the region when it was packed, is automatically positioned as if whitespace
had not been stripped.
|
static class |
LibgdxTextureAtlasWrapper.TextureAtlasData |
Constructor and Description |
---|
LibgdxTextureAtlasWrapper()
Creates an empty atlas to which regions can be added.
|
LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile)
Loads the specified pack file, using the parent directory of the pack file to find the page images.
|
LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile,
boolean flip) |
LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile,
com.badlogic.gdx.files.FileHandle imagesDir) |
LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile,
com.badlogic.gdx.files.FileHandle imagesDir,
boolean flip) |
LibgdxTextureAtlasWrapper(LibgdxTextureAtlasWrapper.TextureAtlasData data) |
LibgdxTextureAtlasWrapper(java.lang.String internalPackFile)
Loads the specified pack file using
Files.FileType#Internal , using the parent directory of the pack file to find the page
images. |
Modifier and Type | Method and Description |
---|---|
LibgdxTextureAtlasWrapper.AtlasRegion |
addRegion(java.lang.String name,
LibgdxTexture texture,
int x,
int y,
int width,
int height)
Adds a region to the atlas.
|
LibgdxTextureAtlasWrapper.AtlasRegion |
addRegion(java.lang.String name,
LibgdxTextureRegionWrapper textureRegion)
Adds a region to the atlas.
|
void |
dispose()
Releases all resources associated with this TextureAtlas instance.
|
LibgdxTextureAtlasWrapper.AtlasRegion |
findRegion(java.lang.String name)
Returns the first region found with the specified name.
|
LibgdxTextureAtlasWrapper.AtlasRegion |
findRegion(java.lang.String name,
int index)
Returns the first region found with the specified name and index.
|
com.badlogic.gdx.utils.Array<LibgdxTextureAtlasWrapper.AtlasRegion> |
findRegions(java.lang.String name)
Returns all regions with the specified name, ordered by smallest to largest
index . |
com.badlogic.gdx.utils.Array<LibgdxTextureAtlasWrapper.AtlasRegion> |
getRegions()
Returns all regions in the atlas.
|
com.badlogic.gdx.utils.ObjectSet<LibgdxTexture> |
getTextures() |
public LibgdxTextureAtlasWrapper()
public LibgdxTextureAtlasWrapper(java.lang.String internalPackFile)
Files.FileType#Internal
, using the parent directory of the pack file to find the page
images.public LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile)
public LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile, boolean flip)
flip
- If true, all regions loaded will be flipped for use with a perspective where 0,0 is the upper left corner.LibgdxTextureAtlasWrapper(FileHandle)
public LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile, com.badlogic.gdx.files.FileHandle imagesDir)
public LibgdxTextureAtlasWrapper(com.badlogic.gdx.files.FileHandle packFile, com.badlogic.gdx.files.FileHandle imagesDir, boolean flip)
flip
- If true, all regions loaded will be flipped for use with a perspective where 0,0 is the upper left corner.public LibgdxTextureAtlasWrapper(LibgdxTextureAtlasWrapper.TextureAtlasData data)
data
- May be null.public LibgdxTextureAtlasWrapper.AtlasRegion addRegion(java.lang.String name, LibgdxTexture texture, int x, int y, int width, int height)
public LibgdxTextureAtlasWrapper.AtlasRegion addRegion(java.lang.String name, LibgdxTextureRegionWrapper textureRegion)
public com.badlogic.gdx.utils.Array<LibgdxTextureAtlasWrapper.AtlasRegion> getRegions()
public LibgdxTextureAtlasWrapper.AtlasRegion findRegion(java.lang.String name)
public LibgdxTextureAtlasWrapper.AtlasRegion findRegion(java.lang.String name, int index)
public com.badlogic.gdx.utils.Array<LibgdxTextureAtlasWrapper.AtlasRegion> findRegions(java.lang.String name)
index
. This method
uses string comparison to find the regions, so the result should be cached rather than calling this method multiple times.public com.badlogic.gdx.utils.ObjectSet<LibgdxTexture> getTextures()
public void dispose()
dispose
in interface com.badlogic.gdx.utils.Disposable