public abstract class BaseTmxMapLoader<P extends BaseTmxMapLoader.Parameters> extends AsynchronousAssetLoader<TiledMap,P>
Modifier and Type | Class and Description |
---|---|
static class |
BaseTmxMapLoader.Parameters |
Modifier and Type | Field and Description |
---|---|
protected boolean |
convertObjectToTileSpace |
protected static int |
FLAG_FLIP_DIAGONALLY |
protected static int |
FLAG_FLIP_HORIZONTALLY |
protected static int |
FLAG_FLIP_VERTICALLY |
protected boolean |
flipY |
protected TiledMap |
map |
protected int |
mapHeightInPixels |
protected int |
mapTileHeight |
protected int |
mapTileWidth |
protected int |
mapWidthInPixels |
protected static int |
MASK_CLEAR |
protected XmlReader.Element |
root |
protected XmlReader |
xml |
Constructor and Description |
---|
BaseTmxMapLoader(FileHandleResolver resolver) |
Modifier and Type | Method and Description |
---|---|
protected void |
addStaticTiledMapTile(TiledMapTileSet tileSet,
TextureRegion textureRegion,
int tileId,
float offsetX,
float offsetY) |
protected abstract 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 void |
addTileObjectGroup(TiledMapTile tile,
XmlReader.Element tileElement) |
protected void |
addTileProperties(TiledMapTile tile,
XmlReader.Element tileElement) |
protected java.lang.Object |
castProperty(java.lang.String name,
java.lang.String value,
java.lang.String type) |
protected AnimatedTiledMapTile |
createAnimatedTile(TiledMapTileSet tileSet,
TiledMapTile tile,
XmlReader.Element tileElement,
int firstgid) |
protected TiledMapTileLayer.Cell |
createTileLayerCell(boolean flipHorizontally,
boolean flipVertically,
boolean flipDiagonally) |
Array<AssetDescriptor> |
getDependencies(java.lang.String fileName,
FileHandle tmxFile,
P parameter)
Returns the assets this asset requires to be loaded first.
|
protected abstract Array<AssetDescriptor> |
getDependencyAssetDescriptors(FileHandle tmxFile,
TextureLoader.TextureParameter textureParameter) |
protected static FileHandle |
getRelativeFileHandle(FileHandle file,
java.lang.String path) |
static int[] |
getTileIds(XmlReader.Element element,
int width,
int height) |
protected void |
loadBasicLayerInfo(MapLayer layer,
XmlReader.Element element) |
protected void |
loadImageLayer(TiledMap map,
MapLayers parentLayers,
XmlReader.Element element,
FileHandle tmxFile,
ImageResolver imageResolver) |
protected void |
loadLayer(TiledMap map,
MapLayers parentLayers,
XmlReader.Element element,
FileHandle tmxFile,
ImageResolver imageResolver) |
protected void |
loadLayerGroup(TiledMap map,
MapLayers parentLayers,
XmlReader.Element element,
FileHandle tmxFile,
ImageResolver imageResolver) |
protected void |
loadObject(TiledMap map,
MapLayer layer,
XmlReader.Element element) |
protected void |
loadObject(TiledMap map,
MapObjects objects,
XmlReader.Element element,
float heightInPixels) |
protected void |
loadObject(TiledMap map,
TiledMapTile tile,
XmlReader.Element element) |
protected void |
loadObjectGroup(TiledMap map,
MapLayers parentLayers,
XmlReader.Element element) |
protected void |
loadProperties(MapProperties properties,
XmlReader.Element element) |
protected TiledMap |
loadTiledMap(FileHandle tmxFile,
P parameter,
ImageResolver imageResolver)
Loads the map data, given the XML root element
|
protected void |
loadTileLayer(TiledMap map,
MapLayers parentLayers,
XmlReader.Element element) |
protected void |
loadTileSet(XmlReader.Element element,
FileHandle tmxFile,
ImageResolver imageResolver) |
protected static int |
unsignedByteToInt(byte b) |
loadAsync, loadSync, unloadAsync
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 convertObjectToTileSpace
protected boolean flipY
protected int mapTileWidth
protected int mapTileHeight
protected int mapWidthInPixels
protected int mapHeightInPixels
protected TiledMap map
public BaseTmxMapLoader(FileHandleResolver resolver)
public Array<AssetDescriptor> getDependencies(java.lang.String fileName, FileHandle tmxFile, P parameter)
AssetLoader
getDependencies
in class AssetLoader<TiledMap,P extends BaseTmxMapLoader.Parameters>
fileName
- name of the asset to loadtmxFile
- the resolved file to loadparameter
- parameters for loading the assetprotected abstract Array<AssetDescriptor> getDependencyAssetDescriptors(FileHandle tmxFile, TextureLoader.TextureParameter textureParameter)
protected TiledMap loadTiledMap(FileHandle tmxFile, P parameter, ImageResolver imageResolver)
tmxFile
- the Filehandle of the tmx fileparameter
- imageResolver
- TiledMap
protected void loadLayer(TiledMap map, MapLayers parentLayers, XmlReader.Element element, FileHandle tmxFile, ImageResolver imageResolver)
protected void loadLayerGroup(TiledMap map, MapLayers parentLayers, XmlReader.Element element, FileHandle tmxFile, ImageResolver imageResolver)
protected void loadTileLayer(TiledMap map, MapLayers parentLayers, XmlReader.Element element)
protected void loadObjectGroup(TiledMap map, MapLayers parentLayers, XmlReader.Element element)
protected void loadImageLayer(TiledMap map, MapLayers parentLayers, XmlReader.Element element, FileHandle tmxFile, ImageResolver imageResolver)
protected void loadBasicLayerInfo(MapLayer layer, XmlReader.Element element)
protected void loadObject(TiledMap map, MapLayer layer, XmlReader.Element element)
protected void loadObject(TiledMap map, TiledMapTile tile, XmlReader.Element element)
protected void loadObject(TiledMap map, MapObjects objects, XmlReader.Element element, float heightInPixels)
protected void loadProperties(MapProperties properties, XmlReader.Element element)
protected java.lang.Object castProperty(java.lang.String name, java.lang.String value, java.lang.String type)
protected TiledMapTileLayer.Cell createTileLayerCell(boolean flipHorizontally, boolean flipVertically, boolean flipDiagonally)
public static int[] getTileIds(XmlReader.Element element, int width, int height)
protected static int unsignedByteToInt(byte b)
protected static FileHandle getRelativeFileHandle(FileHandle file, java.lang.String path)
protected void loadTileSet(XmlReader.Element element, FileHandle tmxFile, ImageResolver imageResolver)
protected abstract 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 void addTileProperties(TiledMapTile tile, XmlReader.Element tileElement)
protected void addTileObjectGroup(TiledMapTile tile, XmlReader.Element tileElement)
protected AnimatedTiledMapTile createAnimatedTile(TiledMapTileSet tileSet, TiledMapTile tile, XmlReader.Element tileElement, int firstgid)
protected void addStaticTiledMapTile(TiledMapTileSet tileSet, TextureRegion textureRegion, int tileId, float offsetX, float offsetY)