Package com.badlogic.gdx.maps.tiled
Class BaseTmjMapLoader<P extends BaseTiledMapLoader.Parameters>
java.lang.Object
com.badlogic.gdx.assets.loaders.AssetLoader<T,P>
com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader<TiledMap,P>
com.badlogic.gdx.maps.tiled.BaseTiledMapLoader<P>
com.badlogic.gdx.maps.tiled.BaseTmjMapLoader<P>
- Direct Known Subclasses:
AtlasTmjMapLoader
,TmjMapLoader
public abstract class BaseTmjMapLoader<P extends BaseTiledMapLoader.Parameters>
extends BaseTiledMapLoader<P>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.badlogic.gdx.maps.tiled.BaseTiledMapLoader
BaseTiledMapLoader.Parameters, BaseTiledMapLoader.ProjectClassMember
-
Field Summary
FieldsFields inherited from class com.badlogic.gdx.maps.tiled.BaseTiledMapLoader
convertObjectToTileSpace, FLAG_FLIP_DIAGONALLY, FLAG_FLIP_HORIZONTALLY, FLAG_FLIP_VERTICALLY, flipY, idToObject, map, mapHeightInPixels, mapTileHeight, mapTileWidth, mapWidthInPixels, MASK_CLEAR, projectClassInfo, runOnEndOfLoadTiled
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addStaticTiles
(FileHandle tmjFile, ImageResolver imageResolver, TiledMapTileSet tileSet, JsonValue element, JsonValue tiles, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, String source, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image) protected AnimatedTiledMapTile
createAnimatedTile
(TiledMapTileSet tileSet, TiledMapTile tile, JsonValue tileElement, int firstgid) getDependencies
(String fileName, FileHandle tmjFile, P parameter) Returns the assets this asset requires to be loaded first.static int[]
getTileIds
(JsonValue element, int width, int height) protected void
loadBasicLayerInfo
(MapLayer layer, JsonValue element) protected void
loadImageLayer
(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) protected void
loadLayer
(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) protected void
loadLayerGroup
(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) protected void
loadObject
(TiledMap map, MapLayer layer, JsonValue element) protected void
loadObject
(TiledMap map, MapObjects objects, JsonValue element, float heightInPixels) protected void
loadObject
(TiledMap map, TiledMapTile tile, JsonValue element) protected void
loadObjectGroup
(TiledMap map, MapLayers parentLayers, JsonValue element) protected TiledMap
loadTiledMap
(FileHandle tmjFile, P parameter, ImageResolver imageResolver) Loads the map data, given the JSON root elementprotected void
loadTileLayer
(TiledMap map, MapLayers parentLayers, JsonValue element) protected void
loadTileSet
(JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) Methods inherited from class com.badlogic.gdx.maps.tiled.BaseTiledMapLoader
addStaticTiledMapTile, castProperty, createTileLayerCell, getDependencyAssetDescriptors, getIdToObject, getRelativeFileHandle, loadBasicProperty, loadJsonClassProperties, loadObjectProperty, loadProjectFile, tiledColorToLibGDXColor, unsignedByteToInt
Methods inherited from class com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader
loadAsync, loadSync, unloadAsync
Methods inherited from class com.badlogic.gdx.assets.loaders.AssetLoader
resolve
-
Field Details
-
json
-
root
-
-
Constructor Details
-
BaseTmjMapLoader
-
-
Method Details
-
getDependencies
Description copied from class:AssetLoader
Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.- Specified by:
getDependencies
in classAssetLoader<TiledMap,
P extends BaseTiledMapLoader.Parameters> - Parameters:
fileName
- name of the asset to loadtmjFile
- the resolved file to loadparameter
- parameters for loading the asset- Returns:
- other assets that the asset depends on and need to be loaded first or null if there are no dependencies.
-
loadTiledMap
Loads the map data, given the JSON root element- Specified by:
loadTiledMap
in classBaseTiledMapLoader<P extends BaseTiledMapLoader.Parameters>
- Parameters:
tmjFile
- the Filehandle of the tmj fileparameter
-imageResolver
-- Returns:
- the
TiledMap
-
loadLayer
protected void loadLayer(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) -
loadLayerGroup
protected void loadLayerGroup(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) -
loadTileLayer
-
loadObjectGroup
-
loadImageLayer
protected void loadImageLayer(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) -
loadBasicLayerInfo
-
loadObject
-
loadObject
-
loadObject
protected void loadObject(TiledMap map, MapObjects objects, JsonValue element, float heightInPixels) -
getTileIds
-
loadTileSet
-
addStaticTiles
protected abstract void addStaticTiles(FileHandle tmjFile, ImageResolver imageResolver, TiledMapTileSet tileSet, JsonValue element, JsonValue tiles, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, String source, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image) -
createAnimatedTile
protected AnimatedTiledMapTile createAnimatedTile(TiledMapTileSet tileSet, TiledMapTile tile, JsonValue tileElement, int firstgid)
-