简体   繁体   English

我想使用pytmx从Tiled(TMX)文件中获取tile标签,但找不到语法

[英]I want to get the tile labels from a Tiled (TMX) file using pytmx, i cannot find the syntax

I can get the image path, and also the ID of the tile 我可以获取图像路径以及图块的ID

however i cannot seem to get the "Type" or the tile or any other properties other than: 但是我似乎无法获得“类型”或图块或除以下以外的任何其他属性:

The tile ID, Width, Height and Image 磁贴ID,宽度,高度和图像

My code example: 我的代码示例:

tmxdata = pytmx.TiledMap('new_map.tmx')
print(tmxdata.get_tile_properties(0, 0, 0))

which gives: 这使:

{1: {'height': '16', 'source': 'images/block.png', 'trans': None, 'frames': [], 'width': '16'}}

when you have a map with a tile in that position 当您的地图上有该位置的瓷砖时

please help, thanks, i guess at least PyTMX is better than the other TMX module 请帮助,谢谢,我想至少PyTMX比其他TMX模块更好

The tile "type" attribute was only recently added with Tiled 1.0, so it would not be surprising that it can't be found yet in the library you're using. tile“ type”属性是最近才在Tiled 1.0中添加的,因此在您正在使用的库中找不到它也就不足为奇了。

Your best option is probably to contact the author of the library about this by opening an issue on the GitHub project at https://github.com/bitcraft/PyTMX . 最好的选择可能是通过在GitHub项目https://github.com/bitcraft/PyTMX上打开一个问题来与库的作者联系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM