public class TmxMapLoader extends BaseTmxMapLoader<TmxMapLoader.Parameters>
Modifier and Type | Class and Description |
---|---|
static class |
TmxMapLoader.Parameters |
convertObjectToTileSpace, FLAG_FLIP_DIAGONALLY, FLAG_FLIP_HORIZONTALLY, FLAG_FLIP_VERTICALLY, flipY, map, mapHeightInPixels, mapTileHeight, mapTileWidth, mapWidthInPixels, MASK_CLEAR, root, xml
Constructor and Description |
---|
TmxMapLoader() |
TmxMapLoader(FileHandleResolver resolver)
Creates loader
|
Modifier and Type | Method and Description |
---|---|
protected void |
addStaticTiles(FileHandle tmxFile,
ImageResolver imageResolver,
TiledMapTileSet tileSet,
XmlReader.Element element,
Array<XmlReader.Element> tileElements,
java.lang.String name,
int firstgid,
int tilewidth,
int tileheight,
int spacing,
int margin,
java.lang.String source,
int offsetX,
int offsetY,
java.lang.String imageSource,
int imageWidth,
int imageHeight,
FileHandle image) |
protected Array<AssetDescriptor> |
getDependencyAssetDescriptors(FileHandle tmxFile,
TextureLoader.TextureParameter textureParameter) |
protected Array<FileHandle> |
getDependencyFileHandles(FileHandle tmxFile) |
TiledMap |
load(java.lang.String fileName)
Loads the
TiledMap from the given file. |
TiledMap |
load(java.lang.String fileName,
TmxMapLoader.Parameters parameter)
Loads the
TiledMap from the given file. |
void |
loadAsync(AssetManager manager,
java.lang.String fileName,
FileHandle tmxFile,
TmxMapLoader.Parameters parameter)
Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.
|
TiledMap |
loadSync(AssetManager manager,
java.lang.String fileName,
FileHandle file,
TmxMapLoader.Parameters parameter)
Loads the OpenGL part of the asset.
|
addStaticTiledMapTile, addTileObjectGroup, addTileProperties, castProperty, createAnimatedTile, createTileLayerCell, getDependencies, getRelativeFileHandle, getTileIds, loadBasicLayerInfo, loadImageLayer, loadLayer, loadLayerGroup, loadObject, loadObject, loadObject, loadObjectGroup, loadProperties, loadTiledMap, loadTileLayer, loadTileSet, unsignedByteToInt
unloadAsync
resolve
public TmxMapLoader()
public TmxMapLoader(FileHandleResolver resolver)
resolver
- public TiledMap load(java.lang.String fileName)
TiledMap
from the given file. The file is resolved via the FileHandleResolver
set in the
constructor of this class. By default it will resolve to an internal file. The map will be loaded for a y-up coordinate
system.fileName
- the filenamepublic TiledMap load(java.lang.String fileName, TmxMapLoader.Parameters parameter)
TiledMap
from the given file. The file is resolved via the FileHandleResolver
set in the
constructor of this class. By default it will resolve to an internal file.fileName
- the filenameparameter
- specifies whether to use y-up, generate mip maps etc.public void loadAsync(AssetManager manager, java.lang.String fileName, FileHandle tmxFile, TmxMapLoader.Parameters parameter)
AsynchronousAssetLoader
loadAsync
in class AsynchronousAssetLoader<TiledMap,TmxMapLoader.Parameters>
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, TmxMapLoader.Parameters parameter)
AsynchronousAssetLoader
loadSync
in class AsynchronousAssetLoader<TiledMap,TmxMapLoader.Parameters>
file
- the resolved file to loadprotected Array<AssetDescriptor> getDependencyAssetDescriptors(FileHandle tmxFile, TextureLoader.TextureParameter textureParameter)
getDependencyAssetDescriptors
in class BaseTmxMapLoader<TmxMapLoader.Parameters>
protected Array<FileHandle> getDependencyFileHandles(FileHandle tmxFile)
protected void addStaticTiles(FileHandle tmxFile, ImageResolver imageResolver, TiledMapTileSet tileSet, XmlReader.Element element, Array<XmlReader.Element> tileElements, java.lang.String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, java.lang.String source, int offsetX, int offsetY, java.lang.String imageSource, int imageWidth, int imageHeight, FileHandle image)
addStaticTiles
in class BaseTmxMapLoader<TmxMapLoader.Parameters>