craftworkgames / MonoGame.Extended

Extensions to make MonoGame more awesome
http://www.monogameextended.net/
Other
1.44k stars 325 forks source link

[Tiled] "Tile object" type is always an empty string #749

Closed PixelDough closed 2 years ago

PixelDough commented 3 years ago

When checking every object in a tilemap, getting the "Type" property of shape objects like rectangles works. However, if you try to get the Type property of a tile object, it gives you an empty string.

PixelDough commented 2 years ago

Figured out how to get what I need. Despite all tiled map objects having a Type parameter, the TiledMapTileObject does not populate that parameter with the tile's Type. I just have to check if the obtained object is a TiledMapTileObject, cast it as one, and then check the type of it's associated tile