APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.maps.tiled

public Class TmjMapLoader

extends BaseTmjMapLoader<BaseTiledMapLoader.Parameters>
Class Inheritance
Imports
com.badlogic.gdx.assets.AssetDescriptor, .AssetManager, com.badlogic.gdx.assets.loaders.FileHandleResolver, .TextureLoader, com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver, com.badlogic.gdx.files.FileHandle, com.badlogic.gdx.graphics.Texture, com.badlogic.gdx.graphics.g2d.TextureRegion, com.badlogic.gdx.maps.ImageResolver, .MapProperties, com.badlogic.gdx.utils.Array, .JsonValue, .ObjectMap

@brief synchronous loader for TMJ maps created with the Tiled tool

Field Summary

Inherited from com.badlogic.gdx.maps.tiled.BaseTmjMapLoader:
jsonroottemplateCachetilesetPathsToGIDs

Constructor Summary

AccessConstructor and Description
public
public
TmjMapLoader(FileHandleResolver resolver)

Creates loader

Method Summary

Modifier and TypeMethod and Description
protected void
addStaticTiles(FileHandle tmjFile, ImageResolver imageResolver, TiledMapTileSet tileSet, JsonValue element, JsonValue tiles, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image)

Implements abstract com.badlogic.gdx.maps.tiled.BaseTmjMapLoader.addStaticTiles.

private void
protected Array<AssetDescriptor<T>>
getDependencyAssetDescriptors(FileHandle tmjFile, TextureLoader.TextureParameter textureParameter)

Implements abstract com.badlogic.gdx.maps.tiled.BaseTiledMapLoader.getDependencyAssetDescriptors.

Meant to be called within getDependencies() of a child class

protected Array<FileHandle>
protected Array<FileHandle>
protected Array<FileHandle>
public TiledMap

Returns:

the TiledMap
load
(String
the filename
fileName
)

Loads the TiledMap from the given file.

public TiledMap

Returns:

the TiledMap
load
(String
the filename
fileName
,
BaseTiledMapLoader.Parameters
specifies whether to use y-up, generate mip maps etc.
parameter
)

Loads the TiledMap from the given file.

public void
loadAsync(AssetManager manager, String fileName, FileHandle tmjFile, BaseTiledMapLoader.Parameters parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

public TiledMap
loadSync(AssetManager manager, String fileName, FileHandle file, BaseTiledMapLoader.Parameters parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

public TiledMapTileSet

Returns:

the TiledMapTileSet
loadTileset
(String
the filename
fileName
)

Loads the TiledMapTileSet from the given file.

public TiledMapTileSet

Returns:

the TiledMapTileSet
loadTileset
(String
the filename
fileName
,
BaseTiledMapLoader.Parameters
specifies whether to use y-up, generate mip maps etc.
parameter
)

Loads the TiledMapTileSet from the given file.

Inherited from com.badlogic.gdx.maps.tiled.BaseTmjMapLoader:
cloneElementShallowcreateAnimatedTilegetDependenciesgetTileIdsloadBasicLayerInfoloadImageLayerloadLayerloadLayerGrouploadObjectloadObjectloadObjectloadObjectGrouploadTiledMaploadTileLayerloadTileSetmergeJsonObjectmergeJsonPropertiesmergeParentElementWithTemplateresolveTemplateObject

Constructor Detail

TmjMapLoaderback to summary
public TmjMapLoader()
TmjMapLoaderback to summary
public TmjMapLoader(FileHandleResolver resolver)

Creates loader

Method Detail

addStaticTilesback to summary
protected void addStaticTiles(FileHandle tmjFile, ImageResolver imageResolver, TiledMapTileSet tileSet, JsonValue element, JsonValue tiles, String name, int firstgid, int tilewidth, int tileheight, int spacing, int margin, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image)

Implements abstract com.badlogic.gdx.maps.tiled.BaseTmjMapLoader.addStaticTiles.

Annotations
@Override
collectImageLayerFileHandlesback to summary
private void collectImageLayerFileHandles(JsonValue layers, FileHandle tmjFile, Array<FileHandle> fileHandles)
getDependencyAssetDescriptorsback to summary
protected Array<AssetDescriptor<T>> getDependencyAssetDescriptors(FileHandle tmjFile, TextureLoader.TextureParameter textureParameter)

Implements abstract com.badlogic.gdx.maps.tiled.BaseTiledMapLoader.getDependencyAssetDescriptors.

Doc from com.badlogic.gdx.maps.tiled.BaseTiledMapLoader.getDependencyAssetDescriptors.

Meant to be called within getDependencies() of a child class

Annotations
@Override
getDependencyFileHandlesback to summary
protected Array<FileHandle> getDependencyFileHandles(FileHandle tmjFile)
getTileSetDependencyFileHandleback to summary
protected Array<FileHandle> getTileSetDependencyFileHandle(FileHandle tmjFile, JsonValue tileSet)
getTileSetDependencyFileHandleback to summary
protected Array<FileHandle> getTileSetDependencyFileHandle(Array<FileHandle> fileHandles, FileHandle tmjFile, JsonValue tileSet)
loadback to summary
public TiledMap load(String fileName)

Loads the 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.

Parameters
fileName:String

the filename

Returns:TiledMap

the TiledMap

loadback to summary
public TiledMap load(String fileName, BaseTiledMapLoader.Parameters parameter)

Loads the 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.

Parameters
fileName:String

the filename

parameter:BaseTiledMapLoader.Parameters

specifies whether to use y-up, generate mip maps etc.

Returns:TiledMap

the TiledMap

loadAsyncback to summary
public void loadAsync(AssetManager manager, String fileName, FileHandle tmjFile, BaseTiledMapLoader.Parameters parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadAsync.

Loads the non-OpenGL part of the asset and injects any dependencies of the asset into the AssetManager.

Annotations
@Override
loadSyncback to summary
public TiledMap loadSync(AssetManager manager, String fileName, FileHandle file, BaseTiledMapLoader.Parameters parameter)

Implements abstract com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Doc from com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader.loadSync.

Loads the OpenGL part of the asset.

Annotations
@Override
loadTilesetback to summary
public TiledMapTileSet loadTileset(String fileName)

Loads the TiledMapTileSet 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.

Parameters
fileName:String

the filename

Returns:TiledMapTileSet

the TiledMapTileSet

loadTilesetback to summary
public TiledMapTileSet loadTileset(String fileName, BaseTiledMapLoader.Parameters parameter)

Loads the TiledMapTileSet 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.

Parameters
fileName:String

the filename

parameter:BaseTiledMapLoader.Parameters

specifies whether to use y-up, generate mip maps etc.

Returns:TiledMapTileSet

the TiledMapTileSet