| Modifier and Type | Field and Description |
|---|---|
| protected JsonReader | |
| protected JsonValue | |
| protected ObjectMap | |
| protected ObjectIntMap |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| 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, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image)
|
| private void | |
| private void | |
| protected JsonValue | cloneElementShallow(JsonValue src)
Returns a shallow copy of the source JsonValue element we pass in. This method only copies the basic type and value (string, number, boolean, or null) from the source element. |
| protected AnimatedTiledMapTile | |
| public Array | getDependencies(String fileName, FileHandle tmjFile, P parameter)
Implements abstract com. Returns the assets this asset requires to be loaded first. |
| public static int[] | |
| protected void | |
| 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 | |
| protected void | |
| protected void | |
| protected void | |
| private void | |
| protected TiledMap | Returns: theTiledMapthe Filehandle of the tmj file tmjFile, P parameter, ImageResolver imageResolver)Implements abstract com. Loads the map data, given the JSON root element |
| protected void | |
| public TiledMapTileSet | |
| protected JsonValue | mergeJsonObject(JsonValue parentObject, JsonValue templateObject)
JSON TextMapObjects contain object nodes containing specific text related attributes. |
| protected JsonValue | mergeJsonProperties(JsonValue parentProps, JsonValue templateProps)
Merges two properties arrays from a parent and template. |
| protected JsonValue | mergeParentElementWithTemplate(JsonValue parent, JsonValue template)
Recursively merges a “parent” (map) object element with its referenced template object element. |
| protected JsonValue | Returns: a merged JsonValue representing the combined JsonValues.JsonValue which contains the single json element we are currently parsing mapElement, FileHandle tmjFile tmjFile)Method specifically meant to help resolve template object properties and attributes found in objectgroups. |
| private JsonValue | |
| private FileHandle |
| json | back to summary |
|---|---|
| protected JsonReader json | |
| root | back to summary |
|---|---|
| protected JsonValue root | |
| templateCache | back to summary |
|---|---|
| protected ObjectMap<String, JsonValue> templateCache | |
| tilesetPathsToGIDs | back to summary |
|---|---|
| protected ObjectIntMap<String> tilesetPathsToGIDs | |
| BaseTmjMapLoader | back to summary |
|---|---|
| public BaseTmjMapLoader(FileHandleResolver resolver) | |
| addStaticTiles | back to summary |
|---|---|
| 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, int offsetX, int offsetY, String imageSource, int imageWidth, int imageHeight, FileHandle image) | |
| addTileObjectGroup | back to summary |
|---|---|
| private void addTileObjectGroup(TiledMapTile tile, JsonValue tileElement) | |
| addTileProperties | back to summary |
|---|---|
| private void addTileProperties(TiledMapTile tile, JsonValue tileElement) | |
| cloneElementShallow | back to summary |
|---|---|
| protected JsonValue cloneElementShallow(JsonValue src) Returns a shallow copy of the source JsonValue element we pass in. This method only copies the basic type and value (string, number, boolean, or null) from the source element. It does not clone child element for arrays or objects. If the source element is an array or object, the entire element is copied using JsonValue's copy constructor, resulting in a deep copy for those types. | |
| createAnimatedTile | back to summary |
|---|---|
| protected AnimatedTiledMapTile createAnimatedTile(TiledMapTileSet tileSet, TiledMapTile tile, JsonValue tileElement, int firstgid) | |
| getDependencies | back to summary |
|---|---|
| public Array Implements abstract com. Doc from com. Returns the assets this asset requires to be loaded first. This method may be called on a thread other than the GL thread.
| |
| getTileIds | back to summary |
|---|---|
| public static int[] getTileIds(JsonValue element, int width, int height) | |
| loadBasicLayerInfo | back to summary |
|---|---|
| protected void loadBasicLayerInfo(MapLayer layer, JsonValue element) | |
| loadImageLayer | back to summary |
|---|---|
| protected void loadImageLayer(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) | |
| loadLayer | back to summary |
|---|---|
| protected void loadLayer(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) | |
| loadLayerGroup | back to summary |
|---|---|
| protected void loadLayerGroup(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile, ImageResolver imageResolver) | |
| loadObject | back to summary |
|---|---|
| protected void loadObject(TiledMap map, MapLayer layer, JsonValue element) | |
| loadObject | back to summary |
|---|---|
| protected void loadObject(TiledMap map, TiledMapTile tile, JsonValue element) | |
| loadObject | back to summary |
|---|---|
| protected void loadObject(TiledMap map, MapObjects objects, JsonValue element, float heightInPixels) | |
| loadObjectGroup | back to summary |
|---|---|
| protected void loadObjectGroup(TiledMap map, MapLayers parentLayers, JsonValue element, FileHandle tmjFile) | |
| loadProperties | back to summary |
|---|---|
| private void loadProperties(final MapProperties properties, JsonValue element) | |
| loadTiledMap | back to summary |
|---|---|
| protected TiledMap loadTiledMap(FileHandle tmjFile, P parameter, ImageResolver imageResolver) Implements abstract com. Loads the map data, given the JSON root element
| |
| loadTileLayer | back to summary |
|---|---|
| protected void loadTileLayer(TiledMap map, MapLayers parentLayers, JsonValue element) | |
| loadTileSet | back to summary |
|---|---|
| public TiledMapTileSet loadTileSet(JsonValue rawElement, FileHandle tmjFile, ImageResolver imageResolver) | |
| mergeJsonObject | back to summary |
|---|---|
| protected JsonValue mergeJsonObject(JsonValue parentObject, JsonValue templateObject) JSON TextMapObjects contain object nodes containing specific text related attributes. Here we merge them, parent attributes will override those found in templates. | |
| mergeJsonProperties | back to summary |
|---|---|
| protected JsonValue mergeJsonProperties(JsonValue parentProps, JsonValue templateProps) Merges two properties arrays from a parent and template. Matching properties from the parent will override the template's. | |
| mergeParentElementWithTemplate | back to summary |
|---|---|
| protected JsonValue mergeParentElementWithTemplate(JsonValue parent, JsonValue template) Recursively merges a “parent” (map) object element with its referenced template object element. Attributes and properties found in the template are allowed to be overwritten by any matching ones found in its parent element. The returned element is a new detached tree (parent = null) so it can be handed straight to the loadObject() method without issues. | |
| resolveTemplateObject | back to summary |
|---|---|
| protected JsonValue resolveTemplateObject(JsonValue mapElement, FileHandle tmjFile) Method specifically meant to help resolve template object properties and attributes found in objectgroups. Each template object links to a specific .tj file. Attributes and properties found in the template are allowed to be overwritten by any matching ones found in its parent element. Knowing this, we will merge the two elements together with the parent's props taking precedence and then return the merged value.
| |
| resolveTilesetElement | back to summary |
|---|---|
| private JsonValue resolveTilesetElement(JsonValue element, FileHandle tmjFile) | |
| resolveTilesetImage | back to summary |
|---|---|
| private FileHandle resolveTilesetImage(JsonValue element, FileHandle tmjFile) | |