Tile Layer Custom Properties: Assign an Object Type?

I’m working on importing the JSON data provided by Tiled. I’m able to create an Object Type (in the Object Types Editor) and assign it to a specific tile in a tileset, however, Tile Layers can’t receive an Object Type. Is there any other way to assign structured custom data to a Tile Layer?

My plan was to import the Object Types as structured data into my program and handle different game conditions based on a property type. Right now I’m just giving Tile Layers a custom property, programming against it, and calling it good. The Object Types give me a way of seeing/checking all of my custom properties in 1 file instead of checking each layer/tile in-editor and/or in separate files. I haven’t dived into Object Layers yet and I’d like to keep it simple. Is there another feature I’m missing? Thanks for your time.

Edit: This applies to Tileset properties as well. They can receive Custom Properties but not an Object Type.

Welcome to the Tiled forum, @fighterwing989!

At the moment there isn’t. The object type definitions were introduced specifically for objects, which were initially the only things that had a “type” field. Later a “type” field was also added to tiles, such that tile objects could inherit it.

However, it would indeed be nice if types, or at least predefined properties, were more generally available and could also be used on layers and tilesets. This is covered by the following issue:

Recently, work is being done on introducing “components”, which are at the moment reusing the “object types”. Initially components can only be added to objects, but this could be more easily enabled for all data types since it doesn’t require the addition of a “type” field. It would also still be an option to generalize the “type” field for all data types, though. This work is being done on the wip/components branch.

1 Like