Open Emersont1 opened 3 years ago
Okay, What seems to be the issue is that if a tile doesn't have a custom property, it will not not loaded into the tiles List for each tileset. This means I'll need to manually add the property to all other tiles, instead of defaulting to zero in code
if a tile doesn't have a custom property, it will not not loaded into the tiles List for each tileset
I noticed this issue as well. I'm trying to create my own tilemap rendering system, and I have to iterate over every tile and get the appropriate tile information from the tileset. But since the tileset data only includes tiles with custom properties, I have to add a dummy property to every single tile, which seems a bit silly to me.
Does anyone know if there's any particular reason why the only tiles included in a tileset are the ones with custom properties?
This is related to how Tiled handles custom properties. Tiles are only exported to the .TSX file if they have explicitly been given custom properties.
If you create your tile set as a collection of images instead of a single source image all the tiles will be in the exported .TSX file.
Take a look here https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#tileset.
A tileset can be either based on a single image, which is cut into tiles based on the given parameters, or a collection of images, in which case each tile defines its own image. In the first case there is a single child
element. In the latter case, each child element contains an element.
I'm not sure If I'm going about this in the wrong way, but I have some custom properties in tiles
Once Its compiled and Loaded via MCGB and Content.Load, looking at the tilesets in the VSCode debugger shows the following:![image](https://user-images.githubusercontent.com/23140112/112762513-ed8bfa80-8ff7-11eb-9892-014aaa69f5b7.png)
This means that When I try to load these custom properties in this example code