public class AtlasTmxMapLoader extends AsynchronousAssetLoader<TiledMap,AtlasTmxMapLoader.AtlasTiledMapLoaderParameters>
Modifier and Type | Class and Description |
---|---|
static class |
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters |
Modifier and Type | Field and Description |
---|---|
protected static int |
FLAG_FLIP_DIAGONALLY |
protected static int |
FLAG_FLIP_HORIZONTALLY |
protected static int |
FLAG_FLIP_VERTICALLY |
protected TiledMap |
map |
protected int |
mapHeightInPixels |
protected int |
mapWidthInPixels |
protected static int |
MASK_CLEAR |
protected XmlReader.Element |
root |
protected Array<Texture> |
trackedTextures |
protected XmlReader |
xml |
protected boolean |
yUp |
Constructor and Description |
---|
AtlasTmxMapLoader() |
AtlasTmxMapLoader(FileHandleResolver resolver) |
Modifier and Type | Method and Description |
---|---|
protected TiledMapTileLayer.Cell |
createTileLayerCell(boolean flipHorizontally,
boolean flipVertically,
boolean flipDiagonally) |
Array<AssetDescriptor> |
getDependencies(java.lang.String fileName,
FileHandle tmxFile,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
Returns the assets this asset requires to be loaded first.
|
static FileHandle |
getRelativeFileHandle(FileHandle file,
java.lang.String path) |
TiledMap |
load(java.lang.String fileName) |
TiledMap |
load(java.lang.String fileName,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter) |
void |
loadAsync(AssetManager manager,
java.lang.String fileName,
FileHandle tmxFile,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
|
protected FileHandle |
loadAtlas(XmlReader.Element root,
FileHandle tmxFile) |
protected TiledMap |
loadMap(XmlReader.Element root,
FileHandle tmxFile,
com.badlogic.gdx.maps.tiled.AtlasTmxMapLoader.AtlasResolver resolver,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter) |
protected void |
loadObject(MapLayer layer,
XmlReader.Element element) |
protected void |
loadObjectGroup(TiledMap map,
XmlReader.Element element) |
protected void |
loadProperties(MapProperties properties,
XmlReader.Element element) |
TiledMap |
loadSync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
Loads the OpenGL part of the asset.
|
protected void |
loadTileLayer(TiledMap map,
XmlReader.Element element) |
protected void |
loadTileset(TiledMap map,
XmlReader.Element element,
FileHandle tmxFile,
com.badlogic.gdx.maps.tiled.AtlasTmxMapLoader.AtlasResolver resolver,
AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter) |
protected static int |
unsignedByteToInt(byte b) |
resolve
protected static final int FLAG_FLIP_HORIZONTALLY
protected static final int FLAG_FLIP_VERTICALLY
protected static final int FLAG_FLIP_DIAGONALLY
protected static final int MASK_CLEAR
protected XmlReader xml
protected XmlReader.Element root
protected boolean yUp
protected int mapWidthInPixels
protected int mapHeightInPixels
protected TiledMap map
public AtlasTmxMapLoader()
public AtlasTmxMapLoader(FileHandleResolver resolver)
public TiledMap load(java.lang.String fileName)
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle tmxFile, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
AssetLoader
getDependencies
in class AssetLoader<TiledMap,AtlasTmxMapLoader.AtlasTiledMapLoaderParameters>
fileName
- name of the asset to loadtmxFile
- the resolved file to loadparameter
- parameters for loading the assetpublic TiledMap load(java.lang.String fileName, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
protected FileHandle loadAtlas(XmlReader.Element root, FileHandle tmxFile) throws java.io.IOException
java.io.IOException
public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle tmxFile, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
AsynchronousAssetLoader
loadAsync
in class AsynchronousAssetLoader<TiledMap,AtlasTmxMapLoader.AtlasTiledMapLoaderParameters>
fileName
- the name of the asset to loadtmxFile
- the resolved file to loadparameter
- the parameters to use for loading the assetpublic TiledMap loadSync(AssetManager manager, java.lang.String fileName, FileHandle file, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
AsynchronousAssetLoader
loadSync
in class AsynchronousAssetLoader<TiledMap,AtlasTmxMapLoader.AtlasTiledMapLoaderParameters>
file
- the resolved file to loadprotected TiledMap loadMap(XmlReader.Element root, FileHandle tmxFile, com.badlogic.gdx.maps.tiled.AtlasTmxMapLoader.AtlasResolver resolver, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
protected void loadTileset(TiledMap map, XmlReader.Element element, FileHandle tmxFile, com.badlogic.gdx.maps.tiled.AtlasTmxMapLoader.AtlasResolver resolver, AtlasTmxMapLoader.AtlasTiledMapLoaderParameters parameter)
protected void loadTileLayer(TiledMap map, XmlReader.Element element)
protected void loadObjectGroup(TiledMap map, XmlReader.Element element)
protected void loadObject(MapLayer layer, XmlReader.Element element)
protected void loadProperties(MapProperties properties, XmlReader.Element element)
protected TiledMapTileLayer.Cell createTileLayerCell(boolean flipHorizontally, boolean flipVertically, boolean flipDiagonally)
public static FileHandle getRelativeFileHandle(FileHandle file, java.lang.String path)
protected static int unsignedByteToInt(byte b)