Read "Type" and "Probability" as first-class citizens for a Tile (.tmx)
See original GitHub issueIssue details
Currently, type
is not being read by BaseTmxMapLoader
, even though it is a base property of a Tile
. Furthermore, probability
is being read, but simply put in the tiles’ Properties
. It would be a good idea to ‘promote’ these base fields to Tile
.
Reproduction steps/code
In Tiled, configure a tile map:
Notice that this will produce some output like:
...
<tileset firstgid="1" name="grass-tiles-2-small" tilewidth="32" tileheight="32" tilecount="72" columns="12">
<image source="grass-tiles-2-small.png" width="384" height="192"/>
<tile id="13" type="Grass" probability="0.5"/>
</tileset>
...
Version of LibGDX and/or relevant dependencies
All versions.
Notice that they are not first-class citizens in BaseTmxMapLoader.java
lines 608 - 620:
for (Element tileElement : tileElements) {
int localtid = tileElement.getIntAttribute("id", 0);
TiledMapTile tile = tileSet.getTile(firstgid + localtid);
if (tile != null) {
AnimatedTiledMapTile animatedTile = createAnimatedTile(tileSet, tile, tileElement, firstgid);
if (animatedTile != null) {
animatedTiles.add(animatedTile);
tile = animatedTile;
}
addTileProperties(tile, tileElement);
addTileObjectGroup(tile, tileElement);
}
}
Please select the affected platforms
- Android
- iOS
- HTML/GWT
- Windows
- Linux
- MacOS
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
TMX Map Format — Tiled 1.9.2 documentation
TMX and TSX are Tiled's own formats for storing tile maps and tilesets, based on XML. TMX provides a flexible way to describe...
Read more >TiledMap tile property "Type" doesn't get loaded #6464 - GitHub
Issue details The Type property on tiles gets skipped during loading and therefore isn't available in libgdx.
Read more >A guide to level creation with Tiled [ + how to use it ... - YouTube
A video about Tiled, including terrains, isometric tiles, exporting and objects. I also cover how to import the resulting data into Pygame.
Read more >Simple TMX Library documentation - PythonHosted.org
This library reads and writes the Tiled TMX format in a simple way. This is useful for map editors or generic level editors,...
Read more >Tiled Documentation - Read the Docs
Tiled is a 2D level editor that helps you develop the content of your game. Its primary feature is to edit tile maps....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing Issue
@lyze237 Should I open up another Issue to also support
type
?